In A Tale of Two Cities, what's happening in and around Paris is the beginning of a revolution. It starts as an underground movement, very secretive and exclusive, centered at the Defarges' wine shop. In order to keep the circle small (until the right time, of course), it's important for them to have signals and signs which outsiders would not know. The rose is one of them. When she places the flower in her hair, the others in the room know what to do--just as they do when she makes the slightest clearing of her throat or when her husband refers to fellow revolutionaries as Jacques. In the case of the rose, she is warning the her fellow underground soldiers to leave the shop.
Mrs. Defarge puts the rose in her hat in Book 2 Chapter 16 Still Knitting. The previous day the Defarges learn of a new spy for the nobles. This spy is named John Barsad, he is 5'9", about 40 years old, black haired, thin faced, and overall rather handsome. These traits are told to Mr. Defarge from a member of the Jacques who is also a police officer.
So connecting back to the rose. These traits are used by Mrs. Defarge to easily identify the stranger that enters their wine shop. Upon his entrance Mrs. Defarge knows he is a spy trying to seek out revolutionaries and have them killed. The rose is then placed in her hat as a warning sign for the rest of the third estate. It acts as a red flag to signal people to stay away from the area.
The reason she wants people to stay away is because Barsad is a spy and majority of the third estate are revolutionaries who seek a change. If the spy heard of any revolutionary talk he would inform the aristocrats and those individuals would be killed. This rose is a warning which acts as a way to save the lives of the third estate.