Both were defeated by allies during ww2, both commited atrocities, so why was West-Germany and by extention Reunited Germany allowed to have a full functioning normal army, while Japan still only has a heavily controlled Self-Defense Force?
First it needs to be noted that both former German states (the BRD and the DDR) had armed forces even before the re-unification of Germany in 1990.
The armed forces of the East German DDR were called the Nationale Volksarmee (NVA) and the West German army was named the Bundeswehr (which is still used as the name of today). The NVA was part of the Warsaw treaty and the Bundeswehr was part of the NATO.
Regarding the difference to the situation in Japan there are a few things to consider:
First, the Japan regained its sovereignty much earlier than Germany - 1952 compared to 1990 (for full sovereignty the signing of the 2+4-treaty). It’s decision to not change the constitution in 1956 as the then prime minister desired and therefore not formally raise an army was a political decision - and one the US didn’t even much favour. Shifting opinions later changed this and the „self-defence“ forces turned more into an army (See here Matsueda, Tsukasa; Moore, George E.; Japan’s Shifting Attitudes toward the Military: Mitsuya Kenkyu and the Self-Defense Force, in: Asian Survey, Vol. 7, No. 9, September 1967, S. 614–617).
The constitutional limits the Japanese imposed on their forces are not that different from the ones the West German BRD imposed before the re-unification.
The Bundeswehr was established 1956 with blessing from the western Allies. According to article 87a of the Grundgesetz - which was specifically changed to that purpose - states among other things that the forces may only be used in self-defence or where the constitution allows it. The only other acceptable reasons were Mutual self defence as part of NATO or on the basis or as part of multilateral UN actions (in which the Japanese also took part). The article is still part of the German constitution and inciting an attack on another state is actually a criminal offence in Germany (even planning to do so is).
With the 2+4-treaty Germany as a unified country regained its full sovereignty (after more than 40 years of at least partial occupation). Therefore Germany could now decide to abandon these limits on its own - but across all political parties there is no intention of doing so (actually the only voices to change anything substantial are left-wing politicians who want to leave NATO or dissolve all military units).