Why does gas form a star instead of a black hole? When a space gas gets pulled together a star is formed. On the other hand, when a massive star dies, it collapses to a black hole. 

You would think that the initial mass of the gas would be bigger than the star that had existed for billion years and lost mass in the process.

So what stopped the space gas from forming a black hole in the first place?
Essentially gas does, it just happens to form a star first. 

Mass is not the only factor in creating a black hole. You also need for this mass to reach a high density. In the process of doing this, a star usually forms. The energy producing processes in the star interior produce a pressure that balances the gravitation attraction. This prevents a star from reaching a critical density needed for black hole formation. As these energy producing processes run out of useable fuel the star will eventually collapse onto itself creating a black hole. 

So you can't just take a large volume of gas and create a black hole. Other physical processes occur.