Well, my name isn't Mark, but I can explain what's happening and why.
Basically, when a carpet smells after a bath just the same way as a dog smells after a bath, the reason is because in both cases you're providing perfect conditions for a bacterial population explosion, and it's the growth and multiplication of bacteria that causes the smell.
Dust, which is mostly organic matter (dead skin cells, fabric and paper fibers, pollen, etc) provides food for bacteria. No matter how good your vaccuum cleaner is, organic dust will eventually accumulate way down deep into the carpet pile. When you then get that carpet wet, you provide what a bacterium would consider "Heaven"; plenty of food and the ability to move around easily in the wettness in the carpet. So, when you shampoo a carpet, the bacteria in it start to multiply like crazy, and it's that bacterial population explosion that makes the wet carpet smell much the same as a wet dog, and for exactly the same reason.
New carpets and dogs that regularily get baths (like show dogs) don't smell like that after a bath because they don't have large amounts of organic food accumulated in them, so there's no bacterial population explosion when they get wet.
To eliminate the smell as quickly as possible, dry the carpet as quickly as possible. That will eliminate the bacteria's ability to multiply, thereby ending the population explosion and the smell. Maybe beg, borrow or steal a dehumidifier and set that up in the middle of the carpet.
And, what you're carpet is telling you is that it's at the end of it's life. You can try vaccuuming it vigorously, but when carpets smell after getting wet the usual cause is that there's so much organic food accumulated so deep in the carpet that vaccuuming won't get it out, and it'll smell every time you shampoo it.
When a professional carpet cleaner is hired to shampoo an old carpet that he suspects is going to stink after cleaning, he'll add a bacteriacide to the solution tank water. So, the water he sprays down on the carpet kills all the bacteria it contacts, and that prevents the carpet smell. It's not the best way of doing things, but he'd rather do that than get complaints about the smell afterwards, or explain to the customer that they really need a new carpet and not get the job at all. You can buy bacteriacide for carpet cleaning at any place listed under "Janitorial Equipment & Supplies" in your Yellow Pages phone directory, and one bottle should be considered a life time supply since your best bet now is to replace that carpet.
And now you know why regular cleaning with a good vaccuum cleaner is the most effective way to increase the life of your carpet. Regular vaccuuming removes organic matter from the surface of the carpet before it has a chance to fall deep into the carpet pile where it can't be removed, but will provide food for the bacteria.
I am also surprised that your carpet will have accumulated this much organic matter in it in only two years. Normally, one would expect that to happen after 20 or 30 years. The only thing I can think of that might explain that is the presence of two dogs rubbing on the carpet combined with a lack of effective vaccuuming.