Sometimes a stain simply cannot be removed. If the "thing" that caused he stain, in your case ... water ... but that water ran through a wall picking up color, chemicals, and who knows what else, then carried that to the carpet, the carpet stain is now redyed with a new color. We call it a stain, but it's literally been redyed and may never go back to it's original color.
If you've tried the usual methods, cleaners, etc. and a good carpet shampooer with a hand held wand, then there's probably nothing else to do except replace it, or just live with it. The color has chemically changed, It may never go back.