Picture someone bathing a baby in a tub, then emptying the dirty water afterward without paying attention, and accidentally tipping the baby out along with it. That vivid image is the basis of this idiom, and it is used as a caution whenever people, in trying to remove something bad or unwanted, end up carelessly discarding something good or valuable in the same act.
The other options miss this cautionary angle. Clean out everything and being thorough both frame the phrase positively, as if it praises removing everything without exception, but the idiom is actually a warning against exactly that kind of careless, all-or-nothing approach, since it can destroy something worth keeping.
Read correctly as a warning, the idiom means throwing out the good things along with the unwanted, so the answer is option 2.