Carpet's not so bad - better than a dirt floor, anyway!
There are many microbes in carpet, but this may not have been the source of his infection. If he had a
joint infection versus a minor skin wound infection, then his infection most likely came from within his own bloodstream, and was triggered by the constant knocking of his knees, so-to-speak
We all have bacteria that get into our bloodstream from time to time. The usually don't get to do any harm, and are defeated by the blood's defense systems. But occasionally if they get in in overwhelming numbers, or if our defense system is not working right, or if the get to hide in a nice hiding place (like inside a joint, for instance) then they can cause a nasty infection.
So, depending on the kind of infection he had, I would not be too quick to blame the carpet. You eat more bugs everyday on your food than you would find in most carpets, anyway. They are not good habitats for the kind of bugs which are likely to cause us infections.
Cheers
Mick the bug man