That was their voluntary decision supported by the population of both states.
A closer analogy would have been some proposals to dissolve the German state forever after WW2, and get its parts annexed by other states. But that didn't happen.
Not to mention that Nazi Germany was actually doing an actual genocide. But that wasn't sufficient to warrant the same fate for them as a nation.
The latter part definitely did. See Konigsberg (now Kaliningrad, a Russian exclave) and all the parts of Germany that were ceded to Poland.
And the expulsion of ethnic Germans living in non-German lands across Europe postwar was certainly a form of ethnic cleansing, even if you believe it was justified to remove the justification Germany had for prewar annexations like the Sudetenland.
And the state of Israel is recognized by other states and the UN.