U.S. court backs Spain over $500M sea treasure