Because two movies ago Spock stuck his selfness into McCoy’s noggin.
In the previous movie McCoy got increasingly erratic, because he was not well to begin with. And remember the plot of the previous movie: kidnap ill McCoy, steal the Enterprise, break quarantine on the Genesis planet, find Spock’s new body & get his selfness outta Bones’s noggin.
Along the way, Kirk has had enough of you, the Enterprise was destroyed, and Our Heroes wound up piloting a stolen Klingon ship to Vulcan.
So, at the beginning of The One With the Whales, our Friends are renegades from the Federation. They destroyed a legendary starship. They only get help from some Vulcans because Spock is involved. It’s been a while, and McCoy is better and Spock is getting along.
But all Our Heroes (two of whom have been nearly catatonic for a whole movie) have going for them is some Vulcan good will, their (seriously tarnished) reputations, and a stolen Klingon ship. But they’re all much better now, and by the time they get to Earth, things are pretty much back to normal.
They still only have fugitive gear cobbled together from their sworn enemy’s stolen ship, plus whatever they had on them on the Genesis planet when the Enterprise went down in flames.
Including, strangely, kidney-growing pills.