Before stashing it away, make sure your towel is thoroughly dry to prevent mold and unpleasant odors. If it's still slightly damp, hang it outside your backpack to dry further as you hike, only folding it up after it's completely dry. Afterwards, you can pack it neatly inside of a breathable mesh bag, which helps with air circulation.