Poor Sans. He had no idea of what Gaster was putting him through. He suffered for Gaster's entertainment!!
Gaster is evil. You only fight Sans to put him out of his misery at the end. Sans doesn't know what he's doing.