I think Spock was big enough to take some good-natured kidding.
The real problem with the ending was the television-related need for it to be upbeat after four men just died. If Kirk is a realistic character, his happy-talk with Spock and McCoy is a total facade here. He has to explain his losses to the Admiralty and probably write letters to four next of kin.
"Obsession" is another offender in this regard. "City on the Edge," "Catspaw," and "A Private Little War" got it right.
Doomsday and Changeling both end with a Gene Coon chuckler at the end, too. It is he -- according to what I've read here -- who lightened the tone and made the crew less military and more familial.
This is an episode people who call Trek "camp" can point to, I think.