Could be either local hotel regulations, some form of owner policy or just the hotel being annoying. It’s relatively common in many cases to lock access to windows when there’s a chance people could jump out.
You’d think just making the hotels a bit more pleasant would be a better idea.