"A well regulated militia..."
Proper training is important, and so is making sure that firearms aren't in places they really have no place in being. In fact proper training should include stuff in regards to not having firearms in places they shouldn't be. A law like this is because a lot of people don't get proper training.
Firearms have no business being in a lot of places.
The law included all daycare and school grounds, college campuses, government and judicial buildings, medical facilities, public parks and playgrounds, correctional institutions, public transit, public demonstrations and gatherings, athletic and professional sporting facilities, public libraries, amusement parks, zoos and museums, places of worship, banks, polling places, gambling establishments, any place where alcohol is sold and any other privately owned commercial establishment that is open to the public — unless the business owner put up a sign saying guns are OK. (Source)
That's not banning you from having a firearm, "anywhere," it's a ban on having one in specific locations. There's no reason to carry a gun into a daycare, there's no reason to carry a gun into a hospital, there's no reason to carry a gun into a zoo, etc.