I strongly believe red text is used when referring to Asgore as someone who kills humans, while yellow text is used when refer to him as a ""merciful"" king.
He is mentioned in red by Toriel, Undyne, and Alphys. It cant be hatred, as Alphys has a crush on him, and Undyne is speaking of him positively.
His name also shows up in yellow several times. I can only recall it happening in Gerson's dialogue, when hes referring to asgore as a big sweetie, but I know it appears at other points. To my knowledge, none of these other yellow-name instances are discussing him as a human-killer, or otherwise implying it (which Alphys' red-name dialogue is).
Undyne uses both colors in just one line of dialogue, but she's discussing the souls and breaking the barrier, and "Asgore" is in red. From what I recall, no other character uses his full title while discussing Asgore needing human souls / killing humans.
Furthermore, his trident, the weapon he has (presumably) used to kill the humans and attempts to kill Frisk with, is red.
I'm curious if anyone has other ideas for the reasoning behind the colored instances of his name, and if / how this info should be added to the Trivia section. (: