According to the film's novelisation, Spock did indeed have misgivings about the mission but those were overridden by his own sense of morality and the fact that he'd already hashed out the arguments with Kirk earlier (off-camera). A further refusal could be construed as mutiny in the face of a direct order, especially since the Captain has explicitly told him that the Prime Directive isn't being thwarted.
Tilting his head slightly to one side, he [Spock] spoke toward the suit’s pickup.
“Captain, did any representatives of the indigenous intelligence see you? At the risk of repeating the obvious and despite the difficulties inherent in our current effort, I must repeat that the Prime Directive clearly states that there can be no perceived external interference with the internal development of an alien civiliza—”
Despite the shuttle’s increasingly violent rocking, Kirk’s response came through clearly.
“No, Mr. Spock, they did not! I know what it says! I might have missed a few details here and there in certain classes . . .” The admirable clarity of the surface-to-shuttle transmission was confirmed as Kirk’s communicator picked up the nearby McCoy’s unmistakable sarcastic snicker. “. . . but I didn’t miss that one. We’re not supposed to be here at all. It’s because of the Prime Directive that we’re having to do this the hard way. Now, drop off your super ice cube and let’s get out of here! Kirk out!”
Then shortly afterwards;
The science officer would have argued further with his captain save
for two reasons: The time to do so had long since expired, and arguing
with James T. Kirk frequently generated far more frustration than
satisfaction. Filing the details of their brief conversation for
future discussion, Spock returned his focus to the business at hand.
Up to that point, Kirk arguably hadn't broken the Directive. He'd certainly distorted it beyond recognition, but nothing he'd done could be construed as a direct violation. A few minutes later when he reveals the Enterprise, that's the biggie and something Spock had no part in agreeing.
“Congratulations, Spock. You just saved the world.”
“Captain. You violated the Prime Directive.”
“So they saw us.” The commanding officer of the Enterprise shrugged. “Big deal.”
Before the science officer could respond further, Kirk signaled to the members of the emergency response team. Any further deprecating comments disappeared beneath a whoosh of coolant gas and sprayed decontaminant.