The poop deck is a raised deck on the stern of a ship. Poop decks are weather decks or partial weather decks (having superstructure above). Historically, the poop enclosed the captain and officers. More recent vessels with a poop tend to house crew accommodations or common rooms.
Poop decks were common on working vessels - the full beam of the vessel can be used, reducing superstructure height. With machinery pushed aft to maximize cargo capacity, poop decks allowed for additional reserve bouyancy; particularly when empty and trimming aft. The forward bulkhead also opens onto the well deck (poop decked vessels commonly also having a forecastle), providing convenient access for the crew.
Most modern vessels forego a poop deck in favour of a taller superstructure. Modern vessels often have lower crew requirements, as such the superstructure can house all of the crew with higher levels of comfort (i.e., large glazed or opening windows instead of portholes/deadlights).