From a religious point of view, God (or Gods) created something out of nothing because he had the power to do so. Many cultures and religions have different, but often similar, accounts of how the world was created. For instance, in the Bible, God simply created the heavens and the earth (from a divine power we simply do not understand), Then He said "let there be light." And there was light. So, we are required to have faith and believe that God just conjured things out of nothing, out of the abstract of his own thoughts.
Scientists might have a problem with this explanation because it is no explanation. And while that may be the case, there are events at the quantum level that are explainable but similarly as mysterious as certain creation stories. For example, at the quantum level, particles can just pop in and out of existence at certain energy levels. Also, consider The Big Bang Theory (not the television show), where/when everything emerged from essentially nothing. In A Brief History of Time, Stephen Hawking writes of the Big Bang:
At the big bang itself the universe is thought to have had zero size, and so to have been infinitely hot.
So, it was an infinitely small (or massless, being only energy) particle from which everything emerged. Having "no size" implies that it was made of nothing. However, it was infinitely hot so "something" was there. It was a massless but energy filled particle. There are particles at the quantum level that are infinitely small (to the point of being massless) and yet they do exist as energy or as potential. Such a notion seems to say that it could be something and nothing.
The least we can say is that everything came from something incredibly small. When the universe was still in that pre big bang stage or big bang particle stage, time would not have existed and it would be irrelevant anyway. With only one thing (the particle) there is no separation of it from another thing, no space around the particle, no sense of separation in space or time. So, while it's difficult to say how something came from nothing, it makes a bit more sense to think about how everything came from one incredibly tiny thing: the big bang particle. It wasn't until that one thing branched out (exploded) and became many things separated in space and time did the notions of space, time, and difference come into being.
Frankly speaking, I have no clue to how did nothing became something. However I would like to point out that this is not just a philosophical or religious matter. As per the "Theory of Big Bang" - a widely accepted, modern scientific, theory - the entire universe was created out of nothing.