I've heard this and read anecdotes to this effect but I haven't seen a legal reference, at least for the US, but if you read it on the internet it must be true.
I do know that you can't obscure the license plate with anything, including an unoccupied trailer ball.
I saw someone claim that because the bumper is supposed to be the farthest thing back, a hitch is in violation, but it's not actually called out in the law books, and there are countless statements on the net saying that there are no laws in any of the states outlawing leaving it in.
Apparently a lawmaker in Illinois
attempted to pass such a law but I think that "session sine die" means "we'll look at this ... another day ... maybe ..." and that was in 2011, so not there.
Considering that in general you can have stuff sticking out the back of the vehicle up to 4' without even a flag, it doesn't make sense that you can't have a hitch attached.
Personally I leave mine in because I use the top of the drop hitch as a step to get the the bed of my truck sometimes (no tailgate; shell has panel doors), and the truck is usually parked out of the way so it's not a ready injury source. I occasionally remove the hitch if I'm going to be parking in a bigger city against theft, but some people around here still leave their keys in the car when they go into the store (local town literally passed an ordinance against doing so because a couple times kids took them on joyrides...).