You can rent one of those Rug Doctors that they have at VONS or Home Depot and clean the carpet with that and it’ll get rid of the smell. Since you can’t do that every week, you can use XO http://www.xocorp.com and it will get rid of the smell in between cleanings. It works like a charm, but you may have to order it online.
Generally, if you spay/neuter your cat before they first go into heat, they will not spray, but there are always plenty of exceptions to this rule. Both males and females will spray, but an unfixed male will spray everywhere.
I’d guess that the previous owners of the place had a cat that sprayed in that spot or near it and the cat is just marking it “Mine”, the smell can linger for years.