Yes, this is the question - certainly not the God of Scripture. Hitler was a pantheist. “God is with us” is some kind of pantheized/nature worship version of Hegel’s World Spirit that is leading Germany into the promised-land of the Fatherland - 1,000 year Reich - a false millennialism that never came true.
It was merely for traditional reasons. It is an excerpt from Matthew 1. 23:
Behold, a virgin shall conceive, and shall bring forth a son, and they shall call his name Emmanuel, which being interpreted is, God with us.
This battle cry was used as early as the 4th century AD by the Romans and later by the Byzantines.
The same motto was mainly used by Martin Luther and by the Protestants, although in the Thirty Years War some Catholic generals used it as well, for example Field Marshal Tilly.
In 1861, King William of Prussia made it his motto, and when he became Emperor then years later, it became the inofficial, albeit widely used, national motto.
In World War Two the German army had it on their belt buckles, just as it had in the First, but the SS instead had the slogan „My honor is loyalty“.
The West German army used it until 1962.