Sleeping in a car isn't illegal necessarily, but there are increasing popup communities that settle in empty/low traffic lots and live out of their vehicles. Like most of America's problems, our politicans are sending police forces to "clean up" the effect, instead of trying to solve the cause.
Afaik it is allowed as long as its only to regain your driving capabilities and not for multiple nights I'm a row on the same place. The Straßenverkehrsordnung does not state otherwise.
I see a lot of areas with "No Overnight Parking" signs or something similar, so they don't make sleeping in your car illegal technically, but you can't stay there over night.
Often times it's loitering charges, loitering being a fancy term for "being out in public whenever it displeases a person of authority". Sitting on a public bench, having a picnic, walking on a sidewalk, sleeping in your car, whatever, all of those can and will get you loitering charges depending on your exact location in the United States.
Then you have public intoxication charges which on paper are only supposed to apply if you're causing a public disturbance (despite disorderly conduct already being a charge for that, public intoxication just makes it more severe), but in reality it's mostly used to harass drunk people who couldn't get a ride home, or uber home, and decided not to drive while drunk. I wouldn't be surprised if you had a higher likelihood of getting arrested for public intoxication while drunk walking/public transporting home than of getting arrested for DUI while drunk driving home. But public intoxication and even DUI can also be used if you're sleeping off drunkenness in your car, while the car is turned off.
Less actually illegal and more that the lots are privately owned and the owning companies can have you removed from the lots of they don't like what you're doing.
In australia, it can be illegal too. Only 1 state has actually made it 100% illegal, that state being Queensland (which is a rather big state too, stupidly enough). Where I'm from (Victoria), it's not illegal at a state level, but some councils prohibit it in their local bylaws. In the rest of our states and territories the act of sleeping in your car isn't illegal, but some of the more affluent and snobby areas try to get around that by not offering anywhere to park overnight without permits or living in the area
There should be secret laws you have to unlock by doing unfathomably inhumane things.
"You chased a homeless person in their own car off your completely unutilized property for no reason other than malice. You've been sentenced to 12 hours of fighting a flock of geese naked while locked in a middle school gym."
Solo Leveling Penalty Game huh? Damnit, I'm in! What do I get for being someone in HR denying someone a job for reasons of "I just wasn't feeling it."?
You? Nothing, you're just being a good cog in a bad machine. Bossman? Rashes, but on the inside of their skin, but that's likely compounded by numerous other crimes.
Yeah, in an article talking about how news stories about crime often show pictures of tents, they pointed out that the photo is of a crime scene, but the crime was not committed by those living in the tents.
I hate Walmart, but they let people sleep in the parking lot there. Cars, RVs, whatever. So if you're ever unfortunate enough that you're stuck sleeping in your car, you can park at Walmart without getting harassed.
Actually Walmart does not allow it, but most stores don’t care. My local one had a guy unalive himself in his car surrounded by other multi day parked cars. It took them 3 days to see all the others cars leave and he was inside. So now they enforce it. Understandably so.