Sans works for his brother all the time. He is hated by everyone in Snowdin because he is the brother of Papyrus, though he tends to spend his time there anyway, at Grillby's. He has had to watch Papyrus kill innocent monsters nearly every day. At first, he hated the attitude everyone had towards him, but after a while, he stopped caring. He was not previously as mean-spirited as he is now, but since Papyrus became a member of the Royal Guard, Papyrus has been abusing Sans's power and using it mostly for his own cruel, selfish desires.
Sans hates humanity because they sent the monsters to the Underground, and because of this, he just wants the whole of humanity to perish. While he respects his brother as his master, he secretly wishes they could at least be more brotherly.