When Dolley Madison ordered that the portrait of George Washington that was painted by Gilbert Stuart should be removed and taken away from the White House, she was acting out of patriotism and a desire to preserve the honor of the country.
This came about during the War of 1812. The British were attacking in various places along the East Coast of the United States. President James Madison had gone off to Maryland to lead some militia who were resisting the British there. In the meantime, the British attacked Washington, D.C. It soon became clear that the Americans could not keep them from taking the city and doing as they liked. Dolley Madison therefore prepared to evacuate. Before she did, however, she took various things from the White House. These included monetarily valuable things like silverware, important government papers, and, very famously, the portrait of Washington. She did not want to leave it for the British to find and to desecrate. She felt that it would be a humiliating thing for the US if the British were to do this.