California has apologized for allowing someone in the US state to register a license plate mocking the October 7 attacks on Israel.