The Folksongs of North America, Song #20, Johnny Has Gone for a Soldier. Alan Lomax writes: "The girl dies her petticoat red to show that she is engaged and loyal to her absent Johnny."
Lomax does not explain why petticoat dying = loyalty, so we must take it on faith.