Because she had little choice.
An egg had opened up randomly right in front of her. We all know facehuggers can leap pretty far and the opened egg was surely about to provide a leaping facehugger aimed at Ripley and Newt. If the egg hadn't opened, Ripley would most likely have quietly left the chamber in the uneasy "truce" situation with the Queen. But since she had to kill that impending facehugger, and the chances were the Queen would retaliate, she went all-out and torched the nest.
Ripley didn't want to start conflict while surrounded. She wanted to get out with Newt alive, because she knew the entire facility was going up in a nuke explosion anyway. But it was better to torch the nearest eggs once the first shot was fired, so to speak, and then to cause enough mayhem to occupy the queen and the warriors. But there's also an element of the basic struggle and hostility (total war) between the two species here; Ripley knows the aliens have no mercy in their struggle for survival, so she has none in her heart to have any for them in return.