Given enough time and resources, the Germans would have produced a bomb.
What held them back was firstly that they were persecuting a large section of their existing scientific and engineering community (many literally going up the chimney) - either for their political views (socialists and communists) or because of their ethnic background (Jews).
The Allied powers on the other hand were mopping up a lot of that German scientific community and were not generally expelling or persecuting anyone (and certainly not systematically killing).
The effect of the Nazi regime on scientific morale was also probably a factor. They had reasonably committed scientists like Von Braun, but not everybody was ideologically reconciled, and would have seen many friends and associates disappeared or forced to leave the country (the Nazi regime was promoted mainly to suppress growing socialist support amongst the populace in Germany).
Whereas the Allies did not seem to have the same ideological problem at the time - the majority were reasonably unified in their opposition to the Nazis, moreso as time went on. That would have been accentuated in scientific circles, surely, by the fact of working alongside refugee German scientists.
A third problem is that of resources. American industry was booming whilst German industry was being smashed.
In places like Britain where industry was also being pummelled, the economy was extensively nationalised at the outbreak of war in 1939 in order to organise and control it efficiently for war, whereas the Germans continued with private sector production until well into the 40s (prompted only because they were falling onto the back foot economically by then).
By time they might have wanted a bomb, they had decimated their scientific community (in numbers and morale), their economy was under siege, and there were too many competing demands (against a speculative nuclear bomb project) for the remaining resources, in a war that by that time was going against them.