I was watching PBS documentary Behind Closed doors. According to that documentary Churchill and Roosevelt were not really sure if Stalin really understood about 'the new kind of weapon' when they mentioned it to him during Yalta conference since Stalin's only response was 'Ok. Thank your for letting me know'. But Stalin apparently knew all about it through extensive Soviet espionage in the Manhattan project. My question is how were America and Britain so clueless about soviet espionage?
The Western allies were not clueless about the Soviet espionage. However, they could not prevent it and were probably underestimating its extent.
The reason they were unable to prevent it is manifold.
The nature of science (and the Manhattan project was much more an open-ended research enterprise than a typical modern-style DARPA project) as understood by the luminaries taking part is openness, not secrecy, so things like "need to know"/compartmentalization were anathema to the participants.
Despite plenty of evidence of its repressive and murderous nature, the Soviet Union and the Communist idea still commanded much sympathy (additionally fueled by the role the Red Army played in the WW2 after 1941).
Some scientists worried about what the West might do with nuclear monopoly.
The reason they informed Stalin officially about the bomb (despite being aware of his espionage) was to bring its shadow to the negotiating table (i.e., making sure that Stalin knew that they knew that he knew about the bomb). The problem the West was facing was that, as the war was winding down, Stalin paid less and less attention to the promises he made about non-intervention in the Polish politics et al since he needed the Lend-Lease less.
Stalin pretended not to understand the importance of the news: he rightly judged that so soon after the war the Western public will not accept an open confrontation with the erstwhile ally, and, indeed, the Western leaders did not press him.
In general, the only successful espionage is the espionage about which the target is ignorant. There is a term for espionage where the target becomes aware the term is "failed".
Kind of like asking why the recipient didn't know about the suprise birthday party; if they know, it isn't a surprise.
Now if your real intent is to ask how the Soviets successfully penetrated the Allied weapons effort, that is somewhat more interesting, but it is definitely a book length answer.
Why did America not know about Soviet espionage in manhattan project
A lend lease expediter stationed in Montana named Major Jordan ( https://en.wikipedia.org/wiki/George_Racey_Jordan ) kept a journal documenting much of the material that was shipped to the USSR.
It seems obvious that at the direction of the executive office the plans and material to make an atomic bomb were given to the Soviet Union.
At the time only Germany and Japan were considered enemies.
Also at the time most considered the atomic bomb just a big bomb as opposed to something horrible.
Soviet espionage as reported by Whittaker Chambers to presidential "brain truster" Adolf Berle. Berle was not only ignored by FDR but Berle was told "Oh, forget it, Adolf." by FDR.
The question remains regarding FDR as to if he was a dupe, pro-Soviet, or being coerced such as with blackmail.