It is not surprising, since the Israelites had just emerged from a long period of bondage in Egypt and the indignity of being a slave was fresh in their memories.
However, it should be noted that there is a world of difference between the slavery in Egypt and the notion of slavery described in the sidra.
In Hebrew there is only one word – eved – to describe both the slave and the servant, and the eved of the sidra is really a servant and not a slave. He has rights, dignity and hope, unlike the conventional slave.
But even so, the Torah is adamant that he must not get too used to his lot. When his period of servitude comes to an end and he is entitled to go free, he must not be encouraged to say, “I like it here; I refuse my freedom!”
Anyone who does this is pinned to the door for 24 hours so that the community can see how foolish he is.
Why the door? Probably because a door represents the way to freedom, and he declined to take it. Opportunity knocked, and he did not want to listen. Freedom may have frightened him, but he had no right to reject it.
In preferring to remain a slave, he rejected one of the basic principles of Torah ethics, that freedom is a gift from God and he who turns his back on freedom has given up his human dignity.