Hypothetically it exists to allow companies to hire singular overseas experts like von Braun or Einstein that don't have domestic equivalents. It has become totally accepted to lie on the application though and now it is used to hire Java developers.
That is incorrect. People with exceptional abilities are covered under EB-1 green cards (and O-1 visas). H-1B was created to bring people in specialty occupations requiring a bachelor's degree or equivalent experience. A Java developer definitely meets the bar (with the right degree or experience).
True, but at the same time immigrants have nothing to lose and everything to gain, thus in many cases they will work harder/longer and as result often be more skilled than an average developer.
And in general skilled immigration has many times over been proven to only benefit the country and that java developer you mention.
That's a sign of how accepted it has become to say that you can't find any local workers that know Python when filling out the H1-B forms. The requirement is there but it's normally overlooked.
"The intent of the H-1B provisions is to help employers who cannot otherwise obtain needed business skills and abilities from the U.S. workforce [...]"
This piece of misinformation seems to be trotted out every time H-1B is discussed. H-1B is not for "extraordinary ability", the O-1 is. The H-1B is just designed for regular workers in a "specialty occupation". This is how Congress designed it in the Immigration and Nationality Act.