Short answer: usually low-fat cream cheese, warm ingredients, or overbeating.
Cream cheese frosting turns to soup more easily than buttercream, so a few rules keep it pipeable. Usefull-fat cream cheese, straight from the fridge — low-fat versions hold too much water to firm up. Beat the butter smoothfirst, then add the cold cream cheese and icing sugar and mix only until combined; the more you beat, the looser it gets. If it does soften as you work, pop it in the fridge for fifteen minutes to firm back up before piping.
Related:red velvet cupcakes with macaron tops · glossary:cream cheese frosting.