Troopers noticed an overwhelming smell of raw marijuana which gave them probable cause to search the car.
Assuming they are telling the truth, there is reason to believe the compartment was in fact used to transport drugs.
most likely the case
I've never done drugs in my life, nor have I ever possessed any drugs.
In college, I had a pretty nice car. The local police stopped me for failing to use my blinker. When I rolled down the window, they said they smelled marijuana and used that as an excuse to tear apart my car without my consent.
Unfortunately, this experience has lead me to distrust the police, in particular when they say they smell drugs. There's no evidence or reproducible test to corroborate the cop's senses. Sure, they can swab the vehicle, but they'll tear up your seats first (and in my state, at the time at least, there aren't convictions for the residue, so there's no point in actually swabbing.)
I happen to think it would be really cool to have a secret compartment. I think they're technologically nifty, and it would be a reasonably safe place to store things that I don't want to be stolen.