Dirty laundry happens.
You can put it in a separate bag so it won’t smell up your clean clothes. If you don’t have a bag just for dirty laundry, put it in a separate laundry bag inside your suitcase. Then toss in a small unwrapped bar of soap from the hotel (2 if necessary). They won’t hurt or stain your clothes and they certainly help with the smell. And you will be able to find them when you get home.
If you aren’t staying at hotels, pack a couple of dryer sheets in your laundry bag before you leave home. They will help keep the odor at bay. Just remove before you do your laundry.
Dryer sheets come in handy if you are going to do laundry at a hotel or laundromat. Typically the water is fairly hard. The dryer sheets will help with static and help soften your clothes in the dryer.