A sharply divided U.S. Supreme Court on Tuesday upheld a Pennsylvania law allowing state courts to hear lawsuits against out-of-state companies registered to do business there, even when the alleged injury occurred elsewhere.