Why are the spheres representing nitrogen and oxygen different colors?
It's for the students to tell them apart.
Of course atoms don't have different colours. But in a model (=visual representation of what you think is happening) you will want to show how for instance a molecule is built up from different atoms.
A difference in size also helps (as between hydrogen and oxygen), but only if sizes are very different.