The US is cheap. We even famously have large gaps between the door/stall panels. I can only imagine it is to accommodate temperature/humidity changes so that they don’t jam.
Nicer places sometimes have actual deadbolt locks connected to a vacant/occupied indicator on the exterior. But it is rare. Usually it’s just a gapped stall with a sliding lock that will often not even line up correctly without wiggling the door.
In some instances I have had to use my gym key fob in place of the missing sliding mechanism to secure the door.