Menopause is another reason. Night sweats, hot flashes and certain other symptoms which are a result of menopause could spoil the quality of sleep.
Even pregnancy could affect sleep quality. Both emotional and physical changes that occur after getting pregnant may impact sleep.
Even factors like leg cramps and the urge to pass urine multiple times during the night could also disturb peaceful sleep during pregnancy.