Given that Sans hates making promises, it's clear that his friendship with Toriel is what made him give her his word.
While appearing as a supporting/comedic character for most of Undertale, it is eventually revealed that he has a wider role of protecting/watching over the Fallen Human after promising Toriel that he would do so. He is a lazy skeleton who loves making puns and drinking ketchup.