I think the corporate sponsorship you talk about here also means that the pressure to fund schools properly through taxes are taken away. It gets too easy to avoid taxes by getting others to pay.
I had a great High School class in genetics that would not have been possible without large donations of money and equipment from a local biotech company.
I have fewer problems with companies donating science equipment, computers, and the like. There have been occasional issues with corporate donated history books though...
I think at my school it was because staff wanted them, so why not have them available for the kids too? I don't think much thought was given to it, and even if there were it would have been framed as a matter of personal responsibility. Adults there would have not thought of their responsibility to teach children good eating habits -- that was for the parents.
I read a bunch of years ago in Branded by Alissa Quart of American schools where soda giants would fund equipment for the sports teams and provide free soda for the cafeteria. So the school would both have to pay for their own drinks in the cafeteria and refuse sponsorship of the sports team to avoid being involved with soda the companies. It just makes economic sense in that case to let the soda company rope the kids in.
It's been a while since I read it, and I can't verify the truth. For me, it sounds like schools should have no part in getting kids addicted to soda.