Theory: Papyrus has innate Determination
Evidence: The fact his skull stays after you kill him (albeit for a short amount of time) and because he wants to get into the Royal Guard so badly
He's also friends with Undyne, the only monster confirmed to have innate determination. Maybe Undyne unconsciously noticed Papyrus' Determination, which is why they're such good friends.