Sorry I do not know a way to save your carpet.
The gold standard repair for a leaking tank is to drain it and remove everything. Then take apart the entire thing. Razor blade off all the silicone, wipe down with acetone. Then tape it up and re-apply a high quality silicone like RTV 108. That said, most people with a small leak will simply drain it, dry, the affected area, razor blade off any silicone that is accessible in the affected area, and then re-apply silicone to the affected area to plug the hole. Sometimes this works, sometimes it doesn't.
As to the cause, how old is this tank? Did it come to you new or used?
Level is less important then flat, when you say its on a shelf that implies to me that the area is not a stand but a bookshelf? If its not flat (especially if its a rimless tank) then that would cause a leak. If its a medium to large rimless tank you may have just run into the end of its life since not all rimless tanks are created equal and some will die after only a few years. The smaller ones, 20 gallons and under, seem to be relatively ok, but you start getting into 40 gallon and up and the thickness of the glass and type of silicone used start to matter a LOT.