Why would you want to write to a file when writing VHDL?
There are tons of reasons to do this.  Waveforms are often not enough, especially if say you are doing some behaviour modelling, or you need to see the impact of your implementation,or there is just too much data ...

One example might be you're designing a video processing circuit that needs to implement a specific output and you need to make sure your integer implementation doesn't introduce any meaningful error vs. a floating point implementation.  First off, this may not even be accessible within a normal persons lifetime as you scroll through the waveforms, you need to see the image of this processing pipeline.

This also allows you to implement your own scripts within your favourite scripting language with al sorts of nice add on features as opposed to using the skill, or TCL scripts that don't support some nice math package.

And this just scratches the surface ...