The reason it rotted is because it has been kept too wet. It is possible that the bag didn't let enough water evaporate out of the soil, so the plant stayed too wet for too long. Yeah, theres still some green on the stem, but look at the top (thats the important part). Its totally brown, and so is about 95% of the stem and leaves.