Actually, I already designed an explosive plant, Pyroberries, for one of my prior settings. I considered the fact that evolution is unlikely, of course, but went with it anyways.
My solution to the high energy cost was not that they directly explode, but rather that the berries are filled with seeds and with pyrophoric liquid, and the berry design is such that when they are plucked, that leaves a gap open to the air, which causes rapid ignition. So no direct mechanical explosion process is required. Naturally the seeds themselves and most of plant are very hard and highly temperature resistant (but not the flesh of the fruit).
If some creature attempts to eat the berry, it sets fire to its tongue after a short delay and probably spits the stuff out, aiding in spreading the seed. If the creature is such that it is hardy enough to have a stomach literally full of napalm, the seeds survive anyway and come out as part of the waste products.
Also, for some reason, if so happens that nothing eats the berry for a whole season, the substance inside becomes inert, and it drops off the bush, rolling to a place where it can grow anyway.
As a nice bonus, the hard seeds make it so that these berries are effectively incendiary cluster grenades (just with dangerously short fuses). In fact, in that setting, they are the prime ingredient used in the manufacture of Thunderstones.
I'm aware this is not exactly what you probably had in mind; but its out there anyways.