No harm done, as long as the magazine isn't loaded beyond its rated capacity. Assuming the spring was properly manufactured, it's repeated cycling of the spring that will wear it out, not loading it once and leaving it loaded.
I suppose heating the magazine really hot while the spring is compressed could be a problem (could anneal the spring in the compressed position), but I think you'd cook off the ammo first.