It's due to the historical kana usage (歴史的仮名遣い(れきしてきかなづかい)) は=わ、ひ=い、ふ=う、へ=え、ほ=お。 へ still retains its use as え, but not as often as は when used as わ. An example of what it looked like: けふ was read as きょう、おもふ=おもう、くゎ=か、ちやう=ちょう、et cetera. Japanese was, of course, simplified, so you don't have to learn a lot of this unless you want to be literate in old Japanese. It just made sense to keep は around as わ because it helped keep things clearer.
Simple answer: when "ha" is used to note the subject of conversation it's pronounced as "wa" to make it easier to pronounce with lots of words.
Kon nichi wa = as for this day... The one being greeted can reply "...today the weather is good" So yeah, this basically means "good day"