It is illegal some places.
Apparently it is in the city of St. Louis.
In my classes at the community college inside city limits, I advise to compost. I got a letter from the city thanking me for teaching the poultry classes but told me to inform my students that it was illegal to have an open compost pile in city limits.
No problem just keep it covered...
JT