To be fair, that's not what he said. That is what the media turned it into. The actual quote was, "Russia, if you're listening, I hope you're able to find the 30,000 emails that are missing, I think you will probably be rewarded mightily by our press." Which is really quite a bit different than inviting a hack. It implies that the hack already happened (which has been implicated somewhat), and that he'd like to see the results of said hack.
Still outrageous, but not the same thing as saying, "Hey Russia, come hack our servers", which is being reported.
Before you all go painting me as a big Trump supporter, I am not. I just think the media tends to twist headlines to get ratings...oh, and in other news, the sky is blue.