In San Francisco and Los Angeles, tens of thousands of middle- and high-school students have returned to classrooms in which they sit at desks with their laptops and learn remotely—the latest twist in the slow reopening of public schools in the nation’s most populous state.