Why did life end up with the big 4 elements, and specifically nitrogen?
Because chemistry built on carbon, hydrogen and oxygen would be very dull and building complex structures from modular components would be impossible

The key point to remember is that life depends on complex chemistry. Living things are, by definition, things that can replicate and things than can build structures that can do complex chemistry. Metabolism is the process of taking simple things from the environment and making them into complex things. This requires complex machinery, built from simpler chemicals available in the environment.

While it might, in principle, be possible to build very complex carbon-oxygen compounds that could metabillise and reproduce themselves, there is no easy way to do so from simple components. But throw nitrogen into the mix and simpler routes to complexity are available.

Take the molecules that make up most of the complex machinery of all living things: proteins. Proteins make up most of the complex machines that do the job of metabolism and they also constitute many of the structural components that make up living things. But they are built from a small number (about 20) simpler chemicals: amino acids. Amino acids are fairly simple chemicals that might be thought of as the equivalent of Lego bricks for building an incredible variety of living structures. Most consist of only carbon, hydrogen, oxygen and nitrogen. All have the core structure $\ce{NH2CH(R)CO2H}$ (where R can be a variety of organic chunks) which constitutes the equivalent of the standardised bricks in Lego allowing all pieces to fit together so more complex structures can be built. In the case of proteins, that core functionality allows a variety of different amino acids to be "strung" together end-to-end (the amino end reacts with the carboxylic acid end on each acid). 

The variety of different structures than can be created by changing the sequence of amino acids is staggeringly, unimaginably large. Many proteins contain hundreds of amino acids and you only need about 60-70 for the possible number of different sequences to exceed the number of atoms in the universe. This means that, by exploiting combinations of simple chemicals (which are not that hard to create with simple chemistry), life can suddenly explore an unimaginably wide range of possible complex structures. Perhaps such structures could be built from fewer elements, but not in a modular way that uses a small range of available components and a single way of joining them together.

The availability of this level of complexity from things that (mostly) consist of C,H, N and O is why the use of nitrogen is key to life. The constraint isn't the availability of the elements (though simple nitrogen-containing compounds are fairly available), it is the accessibility of complex structures from simple components.