Open source software is not automatically better than closed source software. It's the quality of the underlying code that matters. And bad code can be written in public just as easily as it can behind closed doors.
So why do we still stand behind open source?
Open Source Software vs. Open Source Development
Let's first distinguish between open source software and open source development. Open source software is any software whose code is available online. Open source development is a philosophy.
Publishing poor code to the internet does not magically make it not poor (even if you slap a GPL license on it). Browse through Github or Bitbucket, and you'll see thousands of open source software that are unreliable, unmaintained, or painful to use.
Open source development is a way of creating software publically. It's the culture that enables strangers on the internet (programmers and regular users alike) to shape software together.
Open source development results in open source software but not all open source software comes from open source development.
Open Source Development is What Matters
Simply publishing code to Github does have some benefits. For one, it provides transparency. Does this software do what it says it does? Now people can verify this themselves by looking at the code.
But transparency alone is often not enough. Bad code is bad code. Whether it's publically available or not doesn't change that.
Projects that leverage open source development have an engaged community actively seeking to identify/fix bugs, patch security vulnerabilities, suggest useful features, and generally improve the overall quality of the software.
When you have lots of engaged eyes on a project, it's hard for glaring bugs to make it into users' hands.
Open Source is an Antidote to Companies Going Bust
Everyone hates to see it but good companies with solid products disappear all the time. When that happens, their users suffer.
Open source development is the only reliable antidote to this. Even if a company goes bust, if they're open source, not all is lost. Their code is still available (and likely forked several times), there is still community support and most importantly, you can still use their software!
Using openly developed software is a way of not putting all your eggs in one basket.