From a NASA page:
The recovery helicopter one by one retrieved the three astronauts from
the raft using a Billy Pugh net, first Armstrong, then Collins and
finally Aldrin. NASA flight surgeon Dr. William R. Carpentier was
aboard the helicopter and gave them a brief medical evaluation. The
helicopter flew to the Hornet, landing on its deck 63 minutes after
splashdown. From there, sailors placed it on an elevator, took it
below decks, and towed it toward the reception area near the prime
Mobile Quarantine Facility (MQF) – a second MQF was held in reserve in
case problems arose with the first, or in case any of the ship’s crew
was inadvertently exposed to the astronauts or spacecraft. The three
astronauts, Collins first, followed by Armstrong, Aldrin, and Dr.
Carpentier, walked the ten steps from the helicopter to the MQF, amid
the cheers of Hornet’s crew and assembled media. NASA engineer John K.
Hirasaki was waiting inside the MQF and filmed the astronauts
entering. The five of them remained inside the MQF until their arrival
at the Lunar Receiving Laboratory (LRL) at the Manned Spacecraft
Center (MSC), now the Johnson Space Center in Houston, two days later.
The recovery ship USS Hornet had elevators for the aircrafts and helicopters. So the Apollo CM could be moved under deck using the elevator to store the CM protected against rough seas or storms and high waves. The parachute mounting points could be used for tie down of the CM.
Image from this page showing mockups of the capsules on board of the USS Hornet museum ship. So the hangar decks offered enough room to store a small CM and to protect it from rough weather on the flight deck.
The attachment points used for crane transport could also be used for lashing it down to the hangar deck.
Image from this page.