California legislators voted to require schools in the state to allow their athletes to earn endorsement money, setting up a collision with the National Collegiate Athletic Association, which bans compensation for college athletes beyond a scholarship and modest stipend and is threatening to bar California athletes from its competitions.

The California state Senate, nearing the end of the legislative session in Sacramento, passed a bill by a vote of 39-0 that allows college athletes to earn money from their name, image or...