Personally, I use foam on the eggcrate and make my entire background outside of the tank.
I do not attach it by any means when I put it in the tank, I just put it in. I'm pretty careful on my measurements and its usually pretty snug, and that way I can remove it later without headache
The only issue I have run into is that the upper portions of the wall will sometimes lean forward a little. I solve this by simply using a wood feature that is either large enough or leaned up appropriately to prop the wall in place.
I guess worst case scenario, I'd probably use a little clay to secure the top so that removing it would still be easy later.
I don't like permanently affixing to my tanks as they always end up changing at some point or another