Every public school is different. Schools vary even more state to state. For example, the test scores at my public school were the best in the state (including private schools) during the time I went there. Bullying happened as it does everywhere, but the number of incidents were actually very low and far less extreme than many of the stories I heard from many of my private school friends.
As far as homeschooling goes, being a good teacher is not an easy job. Most parents do not have the time, resources, knowledge, and/or abilities to do a good job teaching their children and to keep them caught up with the material they need to know at their age.
In the end, public schools need to be judged on an individual basis. Are some terrible? Definitely. That being said, many public schools actually provide a reasonable education.