14th amendment
No state shall make or enforce any law which shall abridge the privileges or immunities of citizens of the United States; nor shall any state deprive any person of life, liberty, or property, without due process of law; nor deny to any person within its jurisdiction the equal protection of the laws.
上廁所是不是一個人的life, liberty and property, 可以商酌,但是聯邦政府為了維護個人的life liberty and property而幹涉州法,是有憲法依據的。