Probably derived from the historical practice of shaming people by holding them in a pillory (Dutch: schandpaal).
voor paal staan