There are two main reasons why Nazi Germans might have done this. The first one is that the Germans wanted to control all prisoners effectively. Therefore, the numbers were a good way of maintaining absolute control over them, even in the future, as the number could not be removed.
However, the most important effect of these actions was to dehumanize the inmates. By taking these actions, the inmates had nothing left that united them to their past and their individuality. This feelings of nothingness was more likely to cause them despair and lead them to abandon all hope, which was the ultimate goal of the Nazis.