There isn’t a debate.
The 14th amendment provided for the US Constitution to be incorporated down to the state level. The intent seems to have been to bring it all in together, but the US Supreme Court eventually decided on a more piecemeal approach. As cases came through about specific sections of the Constitution, the Court would decide if the section in question applied to the states. For the Establishment Clause in question here, that happened in 1947.
So yes, the text of the Establishment Clause specifically refers to federal Congress, but the 14th amendment then steps in and says it applies to the states.
Incidentally, the 2nd amendment wasn’t incorporated until 2008. If states didn’t otherwise have an equivalent section to their constitution (some do, some don’t), they could have put up whatever gun control measures they wanted.