I don't have any ideas on why your cat did this but if the urine soaked through to the carpet it's best to use an enzyme cleaner, such as SOX, which would throughly remove any urine odor. This should prevent kitty from giving a "repeat performance" on the carpet.

Hope this helps!