Scraping the sides of the pan while making kheer helps prevent the milk from sticking and burning, which can affect the flavor and texture of the pudding.