Overall, bioluminescence has arisen over forty times in evolutionary history.
There are bioluminescent funghi and bacteria.
Phosphorus is the 2nd most important nutrient for plants, so perhaps it's too expensive to use for bioluminescence, most plants don't live in phosphorus rich environments.
Bioluminescence also uses quite a lot of nitrogen, and most plants can't fix nitrogen.
there are 71 species of glowing funghi, perhaps to distribute spores, so plants with spores could have had the same strategy.
If two species of plants used light for night time insects, it can confuse the insects if they are plant specific, light is more confusing than scents.
A tree can potentially produce a lot of light, and it would turn into a forest lamp-post attracting lots of insects. It could be ecologically hazardous. perhaps a carnivorous plant could benefit from it.
It seems like plants and algea easily could have evolved bioluminscence easily, if bacteria and protists have, and that it wasn't profitable to the plants.
A crowdfunded project to make some failed because it was too difficult to put 6 animal genes into the plant.
land animals use light as an indicator of fitness, and plants don't need to indicate their individual fitness to others, and most bioluminescent animals have the option to switch things on and off very effectively, which difficult for trees.