A political party is free to change the rules for nominating candidates however and whenever it chooses. It is free to nullify the decision of those voting in a particular primary. A political party is free to nominate whomever it chooses [and almost certainly multiple candidates for the same office it wishes should it choose].
Ultimately the party, not a judge, chooses whose vote matters and whose doesn't. Placing the imprimatur of the state upon a political party's process doesn't change that or make the process of candidate nomination little 'd' democratic. The people within a political party charged with making the rules for candidate selection are not elected or selected little 'd' democratically. The process of nominating candidates is not little 'd' democratic in any meaningful sense.
This is something we should take away from them. The outcomes of private party activities shouldn't have any impact on the names that appear on ballots. They can maybe mark the names they choose to endorse as an organization, but we should throw away the system where the parties are directly involved in putting names on the ballot (of course they'd be indirectly involved, as an organized group is, uh, organized and thus more ready to act together, so would have an easy time dealing with ballot petitions).
I also don't like that a party could literally pick a name out of hat to designate their presidential candidate. Of course it would be terrible for a party itself to do that, but the system is setup so that name would end up on an awful lot of ballots.