A politician's true ideological position, however unknowable that may be for an outsider, is an important consideration when attempting to determine motive. But it's not the only consideration.
In most states, primary elections make official just who gets to call themselves the Democratic or Republican nominee. But that doesn't mean party leaders have to be neutral in those contests.