I'm confused by your statement. That cheap labor you're referring to is cheap while it's in Poland, but being in Germany, you're now under German contractual union agreements regardless of your nationality, so labor no longer cheap and you're also under German labor law, not Polish. So what gives? Or do you thing German worker's rights don't apply to workers from Poland?
This practice actually became somewhat infamous during the pandemic when an outbreak in a meat factory shined light on Eastern European workers' working and living conditions. The company went on to hire thousands of workers directly in an attempt to salvage some of its reputation but previously had outsourced the work to a network of such staffing companies it claimed to have no insight into while actually having funded (and likely owned) several of them.
- During the West/East divide, West Germany was financially kept alive through major subsidy from the outside, which created political and organizational structures not designed for self-sufficiency. After the unification those subsidies from the national state were all but halted, plunging the city into debt
- A ruthless debt management approach has kept the city from spending ever since, which has resulted in a lot of administrative functions stagnating or slowly deteriorating by e.g. not hiring
Things are improving now, slowly, due to the Capital City effect and the startup boom, but it's important that Berlin is special within in Germany in many ways. In most European countries, if you make a GDP-per-person stat, it falls considerably if you remove the capital city from the equation (say almost 20% in France). Germany is perhaps the only industrial country in the world where it goes up instead.
Note: The Tesla factory, despite being called "Giga Berlin" by Tesla, is being built in the state of Brandenburg, which is not the state of Berlin. Brandenburg has a different complex situation.
Also "Gigafactory Berlin" is only a slight stretch of the truth and has a much nicer ring to it than "Gigafactory Ingolstadt". Being big and flashy is important to Tesla (hence "Gigafactory", not "factory"), and Berlin is just much more recognizable than the alternatives.