I think it's stupid, but punishments that have little or nothing to do with the offense aren't all that uncommon nor unreasonable.
All punishments are intended to deter you from doing whatever it is you did again .. jailing someone for murder has nothing to do with killing someone, except to put that person in a position in which (s)he can't (ideally) do it again. A related punishment would be.. the death penalty .. whoops.
I think what comes off as more "random" in this case is that preventing teens from driving does not necessarily put them in a position in which they cannot smoke again. Arguably, neither do things like fines, for say, speeding, but if you're spending money you're probably working for more money or spending time in court settling the fine, which means you're not spending time out on the road speeding. If you're not driving .. you could still be smoking.
[and I typed this post before Kanchi made the above one about determents, so .. yeah]
一个大西瓜