In order for the universe to be as it is, containing stars and galaxies, it is a requirement that the early universe was at a relatively low entropy state.
Why did the big bang produce this low entropy universe?
The second law of thermodynamics states:
the total entropy of an isolated system can only increase over time
If applied to our universe, one can conclude that the entropy of our universe must necessarily increase over time (or, improbably, stay constant), resulting in the final heat-death of our universe. Just as Georges Lemaître saw that the Universe was expanding and surmised that it must have been smaller in the past (implying a Big Bang), we can also surmise that if the entropy of our Universe is increasing to a maximum entropy wherein the Universe experiences a heat death, it must necessarily have been lower in the past. This begs the question, why was it lower? How did the universe come to be in a state with such low entropy such that stars and galaxies formed. Why did it not spring into existence, already in the heat death stage?
The answer to this is, I don't know. And I'm not sure anyone could know or give a solid answer, backed up by facts and observational evidence. At best, there are some guesses and hypotheses which I can go over a bit.
First off, let me point out that the second law of thermodynamics may not in fact apply to our Universe as a whole. The problem with the laws of physics is that they often apply in localized cases, say when we're talking about a science lab or a galaxy. But when you try to apply them to the universe as a whole, there's just too many unknowns and usually the rules change. For example, is our universe an isolated system? Nobody can answer that because nobody can view the entire Universe. We're limited to only observing the observable Universe so already we can't definitively say that the Universe adheres to one of the primary pre-conditions of the second law.
Not to mention, you have the difficulty that it may be impossible for all, absolute laws to apply to the Universe as a whole, when we already know some of them don't. The laws of physics all rely on each other. If you change one, you affect all the others. We know (or at least some believe) that the law of conservation of energy does not necessarily hold for the Universe as a whole. At any local point in space and for any localized event, it does, but not when applied to the entire Universe. So already the laws of physics are messed up and that will have unknown consequences for other laws of physics when applied to the Universe as a whole.
Energy in our universe is not conserved because it is expanding. This expansion is constantly dumping new energy into our universe, effectively making our universe not "isolated" even if it may be based on the dictionary definition of the word. As such, it's entirely possible for the entropy to be driven down by this energy input via expansion. The initial inflationary epoch, which likely violated energy conservation globally, could have resulted in our low, initial entropy state.
But as I said, a lot of this is guessing and hypotheses. I don't think there's a good answer out there to this good question, and if there is, I'd really like to hear it.