Similar to the idea behind "don't cry over spilled milk", this phrase is widely useful. In a situation where something sucks for person A, person B might have the feeling like, well what are you gonna do, you cant do anything, so get over it, as in shit in a bag, man, there's nothing you can do about it. Thus, person B would say, shit in bags.
Props to Jen Smith, of Chicago, IL.
Person A: "My bike just got stolen!"
Person B: "shit in bags, man, nothing you can do about it."