California has adopted ranked choice voting in primaries. Including Swalwell, there are three democratic candidates and two Republican candidates. The top two vote getters advance to the general election. As it stands, it would be possible to have two Republicans on the general election ballot if the Democrat vote gets split three ways.
Since Swalwell is the least popular of the three democrat candidates, it makes sense for the Democrats to bump him off the primary ballot. When you don’t go willingly, the Democratic machine turns against you in the ugliest way possible.