There is nothing on the wiki proper about it, but it is mentioned on the talk page:
If the blocks below the altar is sand and that you break the blocks below the sand blocks, it will destroy the altar.
There is no explicit mention of whether this will spawn hard mode ore or not, but the wording seems to imply that it will not. The only way to know for sure would be to check the decompiled game code.
EDIT: Brian Hansen has included code from the game in his answerhis answer which answers whether this spawns hard mode ore definitively.