Yes, the movie I was thinking of is indeed "Journey to the Far Side of the Sun" (or Doppelganger).
The instructions given to the Security Officer were "If he shows his hand, I don't want an arrest. Understood?" So when they find out Herbert Lom's character was the spy, he is eliminated! Somewhat drastic in my opinion.
The whole spy thing is used in the movie to convince the United States to fund a manned expedition to the new planet so as to get there first before another country.
So the whole spy thing was to give motivation for the launching of the rocket, without which, of course, there would be no movie.
For an older movie (38 years old) it has some elements that stick in one's memory.
--VM44