1.  Laws are not "whims."
2.  It's not a freedom-of-speech issue.  He could have lectured and preached to them all he wanted, and not run afoul of any law.  He had the right to do all the speaking he wanted.