There's only one law, and it is pretty specific:
"Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances."
They could have asked him to leave. Then demanded he leave. Then arrested him if he refused to leave. That would have been legal.