For me there would be two factors.
1. The weather.
2. Whether or not I wanted to avoid any delays.
Class D clearances are usually readily forthcoming. However, if you end up holding, or are refused a clearance, it will have been quicker to route round - often considerably so.
Routing under may be unattractive in poor weather - do you want to be in a small corridor with everyone else or skirting the zone in the same conditions. In these circumstances a clearance through, under the protection of a radar service, provides some light relief from worrying as much about who you might run into.
(Edited to say that my comments apply generally to class D, with some class D controllers you can almost guarantee a clearance).