The reason you are told to not sleep on your back is that it may partially hinder the blood flow to your baby due to the weight of the pregnant uterus compressing your major blood vessels.
Sleeping on your back is usually safe until you are in the second half of your pregnancy.
However, even during the second half of your pregnancy, sleeping on your back usually poses little risk for your baby, as long as you yourself are feeling comfortable.
Feeling faint or having problems breathing is a sign that the blood flow is being compromised. Move from your back to your side at that point.
Many women will often turn onto their back while sleeping. If there is a significant blood flow hindrance, they will often wake up being short of breath.
Using a small pillow, either on the left or right side of your back, to achieve a slight tilt is always a good idea. This will ease the pressure of your uterus on your major blood vessels.