It was the dominant media image at the time. It was 100% publicity.
There is a difference between convivial behaviour between people on a mission, and a stunt by a private company.
I find the Pioneer Plaque cool and thought provoking. Launching a roadster into space? Not so much.
Maybe the inscription on one of its PCBs will stimulate your unprovoked thoughts: https://i.redd.it/7agxu1qjdz071.jpg
It's like the internet used to be in the old green screen and bang paths days.
I remember everyone from DARPA on down had wonderful senses of humor. Today, even on HN which is supposed to represent the best of the internet, humor is largely frowned upon, or replaced with anger.
Hopefully this slow opening up of space to the masses won't mean making everything sterile and boring, like happened to the 'net.
I'd say maybe 10% of that stunt was for publicity. The rocket had to be tested, it had to include a payload, and sending a suit to space provided extra data as well.
edit: let's also not forget that there always been an element of humor in spaceflight. Apollo 10's callsigns were Snoopy and Charlie Brown. Watch the funny moonwalk videos. Read transcripts of flights. It's okay to have a laugh in space. The astronauts who make it to Mars will sorely need it.