Wet carpet grows mold, and mold makes people sick. You need to get that carpet checked by professionals.
If the carpet is more than two years old, the dirt in it almost certainly weighs more than the carpet. So you may as well just replace the carpet because that is probably about the same cost as mold remediation. Just be sure the floor underneath is bone dry before the new carpet is laid.