You don't need a reason for the party not to kill the dragon. What you need is some motivation for the dragon not to kill the party. After all, based on what you've described, you've got an angry ancient dragon that could just squash the PCs like bugs if it wanted — there has to be some pretty good reason for it to hold back from doing so.
Once you figure out why the dragon wants to keep the PCs alive, everything else falls into place. Sure, if your players are such total murderhobos as you describe, the may well decide to attack the dragon — but if the dragon is also as powerful as you describe, it really makes no difference. The worst they could do is piss off the dragon — but in the scenario you describe, the dragon is already pissed off anyway, and only holding back because it wants something else from the PCs than their lives.
The way I see this encounter going, the players will most likely attack the dragon, or at least try to. The dragon will then use its breath attack to paralyze the PCs, or disable them by some other means. Once the PCs are properly subdued, the dragon will then patiently explain to the PCs what a bunch of idiots they are (feel free to roleplay this part — you know you want to) and that they should all be dead at this point, but for one thing...
Of course, the tricky part is coming up with a good reason for the dragon to actually need the PCs alive for some purpose. Of course, an obvious (and therefore somewhat cliché) reason is that the dragon wants the players to perform some service (quest!) for itself, but ideally, it really should be something that the dragon cannot just as easily a) do itself, or b) get a smarter and/or more obedient bunch of adventurers to do equally well.
Here, I would like to draw your attention to the expressions "cat's paw" and "plausible deniability". Whatever the dragon wants the PCs to do, it could be something that the dragon does not want to be personally involved in, and ideally something that is reasonably in character for the PCs to do on their own (i.e. probably killing something and stealing its loot). It also makes perfect sense for the reason (and possibly the entire mission) told to the PCs to be something more or less completely different from the actual reason the dragon wants the PCs to be involved — most likely to their detriment. But that's for the players to find out later (all in the name of fun and a good adventure, of course).