Private entities have no legal obligation(thin "town hall" argument or not) to respect free speech, and are absolutely empowered to police content as they see fit.
The ever relevant XKCD: https://xkcd.com/1357/
For an elected legislative body to come in and say it's "illegal" to post content(and they are by making the inverse equally illegal), they are explicitly treading on the free speech rights and Section 230 legal protections of companies like Facebook and Twitter.