There should obviously be a difference in the way that an event like a potluck dinner and a meal in a chasin restaurant are treated. The consumer has more control over the chain of events at a potluck. He is aware of there being more of a risk and assumes such risks.
Nobody is earning their living preparing baked beans for a church social.
This common sense approach seems absolutely perfect to me. However, it isn't the situation in the law as it exists today, for reasons Drk explained.
The problem is that if someone gets sick from the potluck, that potluck probably took place in a church or a community center. That church may rent space in their building to community groups. If they do, they may be treated exactly like a commercial entity. After all, they are collecting revenue, right? So it may be said that they are acting like a business, and that means if they see an activity with a forseeable risk, such as eating baked beans, it is their job to mitigate such risk. They can be held liable if they don't.
As Drkitten put it, it's their job to make sure that people like me take food safety seriously. At least, that's what the law says.
In practice, what we see more and more is not actually a wave of lawsuits against Cub Scouts. What we see, though, is a lot of insurance companies that have told churches, community centers, etc. that those facilities will have to pay more for insurance if they allow food to be prepared or served in their facilities. The churches decide to save the money, and institute "no food" policies. Even for clubs that carry insurance, they just decide it isn't worth the hassle. They aren't really renting out their hall as a commercial activity anyway. They just consider it part of their duty to the community. If they can get sued for it, to heck with it.
I can tell you for certain that it's a lot harder to find sites for activities like club banquets, chess tournaments, and Cub Scout potlucks than it used to be, and liability insurance is the major cause.