From
http://www.americangraduateeducation.com/articles/en/post-ma...
"In order to sit for the bar examination, most states require an applicant to hold a Juris Doctor (J.D.) degree from an American Bar Association (ABA)-approved law school. For those individuals who have not earned a J.D. degree from an ABA-approved law school, bar admission authorities have developed varying requirements and criteria to ascertain if such individuals meet the minimum educational requirements for bar admission. In most U.S. jurisdictions, individuals who lack a J.D. are ineligible to take the bar exam..."
[0] http://www.nysscpa.org/cpajournal/2005/605/essentials/p54.ht...
Why? Because I'm liable for malpractice if I get it wrong. Unless I'm willing to religiously follow the legal developments of X other nations, I would not be willing to take the risk of the law having changed since I last check it. And if I were the kind of person anal enough to follow legal developments in other countries, my skills would be in such demand that only megacorporations could afford my services.
Keep in mind, there isn't much incentive to learn US law when it's illegal for you to practice in the US. If the US allowed foreign graduates to sit for the bar and provided a visa and path to a green card to anyone who managed to pass and hold down employment, I think many foreign law schools would appear. Many would fail, but many would pass, and some would be very talented. Honestly, I don't think it would be all that different from software development, though I suppose the bar requirement would probably establish a higher floor than you see in programming.