Is that the law?–Shylock
“I pledge allegiance to the Flag of the United States of America and to the Republic for which it stands, one Nation under God, indivisible, with liberty and justice for all.”
Justice, not legality, comes first; unjust laws should not be enforced nor obeyed. The Fugitive Slave Act from long ago is an example.
Shakespeare addresses this question in “The Merchant of Venice.”
Words such as “legal” and “citizen” are not found in the Pledge of Allegiance,” but the phrase “justice for all” is prominent and is found in every version of “The Pledge” since 1892.
“Citizen” occurs rarely in The Constitution and never in the Bill of Rights, which refers only to persons. Justice is the first thing mentioned in The Preamble.