If you're asking, "why weren't they caught?", the real answer, inasmuch as there is one, is that the security apparatus of the Manhattan Project was designed more to avoid leaks and rumors than it was to detect espionage. Their priority was on making the bomb, not protecting it from spies. Spies, however undesirable, could not stop them from making the bomb, but an ill-timed leak might. It also did not help that they thought they had successfully detected, and stopped, a Soviet espionage attempt — at Berkeley. But it turns out that was quite minor compared to what was going on at Los Alamos.
In retrospect, several of the key spies were laughably obvious had they been really looking for Communist spies. David Greenglass was such a loud-mouth that his bunkmates all knew he was a Stalinist. Any kind of careful investigation into the circumstances that led to Klaus Fuchs being part of the British bomb project would have revealed he was a Communist. Ted Hall walked into the Soviet Embassy in NYC while on leave from Los Alamos and nobody noticed, because nobody was paying attention to who walked into the Soviet Embassy. And so on. The only one who was a "real spy" in the sense that he had training, fake documents, a fake back-story, things like that, was George Koval. All of the others were totally amateurish.
One also has to remember the size of the project. Los Alamos had thousands of people working at it. The Manhattan Project as a whole was around 500,000 people over the course of its life. So spotting a dozen or so spies (of which maybe four or five were really important) in that mix would be a tall task for everyone, especially during World War II where the priority was on success and being close with the Soviets or Communists was not as disqualifying as it would later become.