Probably because checkmate ends the game. If a player could make a move exposing the king to check there would be cases where one player could checkmate first.
That and some people would try and be tricky and hope their opponent doesn't see it. It already sometimes happens in games where it is illegal.
I'm wondering why the rules prohibit you from hanging yor king, it would be the ultimate blunder and lose instantly. Why is this ultimate blunder an illegal move?