I mean, they have been trapped down there for hundreds of years, they are desperate to get out after both Asriel and Chara died. They needed hope. There is also a theory that HP can be hope, hence way sans only has 1 hp, he has next to no hope. Where as Undyne has so much hp because they have the hopes of all the monsters in the underground.