Spoiler from the novel
Sensei saved Shiro when she was the spider in class from the hands of the bad, mean antagonist in the anime, like ya know, this pal that is a pawn of Sophia and wants to be the center of the world. To put it simply, Shiro wants to repay the favor.