Our school has the homemade food rule too, but most teachers are willing to work with parents.
The issues are really food allergies, unhealthy food served at school, competition with the cafeteria (yep, that's one too...so no pizza from outside sources), cleanliness of preparation and knowing ingredients.  I ususally bring two dozen donuts (Round Rock, of course) for my sons' birthdays.  
Some principals and teachers are really strict about it some aren't.  All it takes is some kid with a severe peanut or egg allergy and parent with the attitude "allergies are all in their heads, what they don't know can't hurt them" and you end up with a kid in the emergency room and the teacher and school getting sued.  That's not good for anyone.