The top is leaking somewhere. If you search the JK section for posts with the word "leak," "leaking," "wet," or "damp" in the title you'll get tons of threads.
You can of course start looking over the weatherseals to see if there's anything obviously out of place. Also take a look at the JK leak manual (here
Rather than bothering with any of that, Here's
what I did in response to damp passenger carpeting until I linex the whole thing in the future. There are plenty of links in there to others with similar issues, and pics from a guy who had his interior linexed for $700 after he did all the prep work.