The bed of a pick-up truck is for CARGO, not people. If you care about your passengers (or your pets), do not allow them to ride in the back of your truck. You may be the best driver in the world -- but you are not always totally alert while you are driving. You never know when some other driver may cut you off or cause a collision some other way. Don't put people or animals at risk by allowing them to ride in unprotected places.
In a collision, the sudden deceleration or other crash forces will launch the person out of the bed. Most of the time, no amount of "holding on" can prevent this (even at slower speeds). In some collisions I have attended, pick-up bed passengers thrown out this way have been subsequently run over by the vehicle -- or other vehicles.
In a neighborhood close to mine, a young woman riding in the open back of a Jeep was thrown out and crushed when the Jeep rolled over her after being hit by another vehicle. That car had run a stop sign. This was a young lady that NEVER went without a seat belt, except, reportedly, that one time. There weren't enough seat belts to go around, so she had her friends sit where the seat belts were. She was just seventeen, a great kid, and I'm sure her family still misses her deeply.
Some drivers allow passengers in the back of a pick-up only when the bed is covered by a camper shell -- they believe this affords the occupants some protection in a crash. Think about that for a minute. Have you ever seen how camper shells are constructed? In most cases, they are not very substantial, and they are certainly not capable of providing any protection to a passenger. In a roll-over crash, a camper shell will likely crush like an aluminum can. If your truck has roll bar protection in the back, and seat positions with seat belts and shoulder harnesses, then maybe it is OK for someone to ride there -- but not otherwise.
While many states do not have specific laws that make riding in a pick-up bed illegal, some may have laws that make it illegal for certain specific people to ride there. In Arizona, for example, we have a child safety restraint law that requires any passenger under the age of five to be placed into a child seat and the seat to be buckled into the vehicle properly. The way this law is worded, it makes it illegal for a child under five to be placed anywhere in the vehicle there is no seat belt. Normally, the people that ride with me are people I care about; so, law or no law, people and pets ride IN my truck, strapped safely into place, not unprotected in the open bed.