You pledge allegiance to the flag and to what it stands for. Liberty and justice for all.
Perhaps not to a person, but the idea is the same. It doesn't say "I pledge allegiance to the constitution" but it comes close.
If you are a citizen in this country, live here, work here, play here, and aren't willing to pledge your allegiance to it, don't let the door hit you on the way out.