Fabian Ruiz opened the scoring with a long-range strike early on, then Dani Olmo doubled the advantage in the 69th from close range after goalkeeper Alex Nubel could not handle a shot from Ruiz.
Nadiem Amiri pulled one back for Germany two minutes from time with a long, deflected shot.
Spain avenged defeat to Germany in the 2017 final.
Ruiz, a midfielder with Napoli, was named player of the tournament.
Source: FOX Sport