The initial conditions of the universe are a profound mystery, and inflation offers a possible explanation for why the universe looks the way it does.
The law isn't justice. It's a very imperfect mechanism. If you press exactly the right buttons and are also lucky, justice may show up in the answer.