She was acting under the influence of Mr. Rochester, who had instructed her to do so.
It's important to note that Mr. Rochester's motive for setting the fire was to cover up the presence of his mad wife, Bertha Mason, who was hidden away in the attic. He believed that the fire would destroy any evidence of Bertha's existence.