Representative Eric Swalwell of California had been in a crowded field vying to succeed Gov. Gavin Newsom.