Front doors in Morocco and America are very different. In America they tend to be made of wood. In Morocco they are generally metal. The locks are also different. In America it is impossible to lock a person inside a house. In Morocco it is expected.
The locks on doors in America tend have a knob which can be locked by hand from the inside, and by key from the outside. They also have a deadbolt, which is locked in the same manner. Moroccan locks also have a deadbolt of the same description. However, in place of a knob they have a different kind of lock with a spring-powered latch that automatically locks the door when closes. It also has its own bolt that can be moved from either side with a key. What this means is someone can leave the house taking the key with them and effectively lock inside whoever is left behind.
The logic behind this is that one might want to lock people inside a house for their own protection.