Unions aren't the reason for failing schools and I don't see how anyone could make the argument they are. If most of the failing schools tend to be urban schools as opposed to suburban, I don't really think it is necessarily a teacher issue at all but rather a student issue.
You have the rich district where the kids are all raised in an environment where they are expected to stuff and heavily monitored by their parents.
You have the poor district with the kids who have only one parent and that parent works so they have no time to really devote a lot of attention to their kids study habits and school life.
Is it any wonder the poor or inner city schools fail?
I don't think teachers are the problem at all.
In regards to teachers I think the best thing we could do is increase their pay to draw in more people to the profession and increase the number of teachers so that there are less kids in the classroom. That isn't enough but I think it'd help a lot. But we have to be ready to pay for that in taxes.
For the rest of the issue well that is a parent issue, but perhaps if we had more programs in place in society to aid with situations outside of school that it'd help situations in school too. After school programs in inner cities and rural areas including both academic help and other activities like sports.
^^^This. All of this.
I would also like to add, especially with regards to the part about poor districts, that investing in the broader communities (not only the schools themselves) can help solve many of the background problems that the schoolkids face. Better jobs with better hours = family/household stability, criminal activity and "bad behavior" become less attractive, more involvement with kids' lives, creates a sense of stability and opportunity, improved health and well-being, less stress, etc.
Obviously not a magic bullet, but IMO the worst schools tend to be in economically struggling areas, whether they be rural areas, small industrial towns/cities, or big cities.