It could stem from a number of things One of them could be from a temporary elevation in blood pressure.
If your pressure is up a bit, then the small capillaries, within your nasal mucosa could tend to leak a little blood. Most likely though, It is from dry nasal passages, due to a dry or cold environment, without very little humidity.
After awhile particularly after sleeping throughout the night. The lining will have become even dryer and/or crustier . A result of this, it could be that the nasal epithelium, or lining of the nose becomes irritated in return, and causes a seepage of blood from one of your nostrils.
Again just a few things that it could be among many. I hope this helps answer your question somewhat.