Indeed, the German military was very good at its job. The restrictions placed on it by the Treaty of Versailles led to it having a much larger officer component than usual during the interwar period, which led to some really talented officers like Mannstein, Guderian, Rommel, etc. rising through the ranks, and the street fighting between brow shirts and red shirts had the side effect of creating a generation that was used to casual violence even before the Nazis institutionalised it. It's not for nothing that Wehrmacht translates to "war machine."
It was logistics and politics that defeated the Germans, not the performance of the military.
Logistics
are the responsibility of the military. The Americans understood that well, which is why they created the massive Services of Supply.
One argument has it that the demise of the old Great General Staff of the
Kaiserreich under the treaty regulations severely handicapped the
Reichswehr and
Wehrmacht in the Second World War. The only segment of the staff that survived was the old Operations Section, which was disguised as the Troop Office (
Truppenamt). That meant that when the German staff was resurrected under Hitler, it contained men trained almost entirely in operational warfare and not in the logistical support of those operations. I think that this is true, but exaggerated. The German way of war, or
Truppenpraxis as described by Rob Citino, always placed a premium on short, decisive conflicts in a geographically constrained space. Institutionally and psychologically, the German military was incapable of fully understanding warfare in other contexts. This led to bizarre decisions, especially in theaters like North Africa and the USSR that required sustained efforts in a vast space against enemies not susceptible to a
kurz und vives knock-out punch. Of course, it certainly didn't
help that the Hitler-era General Staff was stuffed with warfighting staff officers rather than railway men like Groener - but it wasn't the cause of Germany's difficulties.
Also, the Germans got straight-up outfought
plenty of times during the war. They got outfought on the tactical level, they got outmaneuvered on the operational level, and they got outthought on the strategic level. They made plenty of bad decisions, not all of which - or even most of which - can be plausibly attributed to Hitler. The tremendous successes of the early years and the Germans' favorable ratio of casualties against the USSR throughout the war don't erase that fact.