Why do extra flight crew members sit in the cockpit during takeoff/landing?
There'a a few reasons for this:

Safety:
During takeoff and landing, everyone should be buckled into a secure seat. They have these seats in the cockpit, and in large aircraft, they're actually very comfortable. Laying down in a crew bed would not be allowed during takeoff or landing (though it happens, off the record). Do note that these beds do indeed have belts that are similar to those on rolling hospital beds, but it's not intended that these be used during takeoff or landing. It would be very difficult to escape the small confined space of the crew bunks during an emergency. Though some crew areas have seats, these are typically not "safe" seats, and they are only meant for resting on while in level flight.

Redundancy:
If something goes wrong with one, or both, of the pilots flying, you would really regret letting the other two qualified pilots go lay down in the back of the plane. Safety comes first in aviation, and the pilots are there to support each other.

Extra Help:
Extra crew sometimes helps the flying crew, whether that be by looking up information, radio frequencies, airport identifiers, and so forth. 

Socializing:
Pilots are (usually) pretty friendly to each other. They all share a common interest, and while some of the older pilots may be a bit grizzled, they all got into aviation for their love of aircraft. There's typically some pretty lively conversations in the cockpit. As noted in the comments, this is while on the ground, pre/post taxi. Even during flight operations, additional pilots may be in the cockpit assisting with spotting traffic, birds, and so forth. Conversation is limited somewhat during taxi, takeoff, landing, and all other flying activity below 10,000ft (or until at cruising altitude, if cruising altitude is &lt;10,000ft),