Why do people wear pajamas instead of nightgown?

Huh? It's a personal choice. Some wear neither. Please elaborate as to the point of your question.
Depends upon goal. Most consider pajamas more comfortable and warm but they are not very sexy. Nightgowns and less warm but can enhance other aspects of sleep especially with a partner. The choice is personal.