It is a general statement of direction and principle, like pledging allegiance to the flag.
If you pledge allegiance, you indicate your general sentiments, but don't bind yourself to do any particular thing. You are still a free citizen, and will use your judgement on what actually constitutes a republic of laws, and what does not.
But we don't need a law to say the Pledge of Allegiance.