It is worthwhile to protect electronics with a 3D printed PLA case? PLA is flammable, but a good case can protect the main board from dirt.
Is it worthwhile to protect a circuit board with a 3d printed case?
As pointed out by Ryan Carlyle, not all 3D printing filament is flammable (such as PET and PETG), and the question therefore rather becomes:

Can 3D printing be used to make proper electronic cases?

And the short answer to that is yes. 3D printing allows to make customized cases of all varieties. Also, since there is huge variety of materials available, you not only restricted to cases of plastic filaments - should this be of interest.

Then again, it all depends on what you are protecting your electronics from. If you plan on submerging your electronics into water or throw them into a fire, 3D printing might not work for you at all. If dust protection is your only concern, however, 3D printed cases should do just fine in most cases.