The 6-to-3 ruling clears the way for legal challenges to similar restrictions in California, New Jersey, Maryland, Hawaii and Massachusetts