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 that 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 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.