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而干涉州法,是有宪法依据的。