It seems you will throw out the law as unconstitutional because the constitution did not specifically empower government to ask that question. Your position is absurd.
No.
Your lack of understanding of our system of government is abysmal.
The only powers that government have are those specifically granted to them by the Constitution.
Amendment X.
The powers not delegated to the United States by the Constitution, nor prohibited by it to the States, are reserved to the States respectively, or to the people.
Translation for the hard of understanding:
The Constitution grants powers, those powers not granted specifically to the Feds by the Constitution, or prohibited to the States by the same Constitution, fall on the States, or the people.
The Feds have no powers other than those specifically granted to them by the Constitution.