The answer to your question depends on what type of background you have in mind.
If poster board, then tape is really the only option. I cut the board to the exact size inside the frame, then use black vinyl electrical tape to secure it.
If it's a glossy commercial background you can use tape OR buy a commercial oil marketed for aquarium backgrounds OR you can just use mineral oil (the same oil used on butcher block counters). DON'T be tempted to use a vegetable oil as it will go rancid and be bad!
You simply coat the glass with a thin layer, (a small sponge roller is best) apply the background, then use a credit card or plastic scraper (from the center outward) to adhere it and push out any air bubbles. This actually yields a much better, more life like look to the background.
Then there is paint. Acrylic is good although most paints can be removed with a single edge razor blade if/when desired. I recently did the back and bottom of a 10g with Plasti-dip (black) spray - which should peel off nicely if/when I want.
In any case, make sure the outside glass is very clean first as smudges can stand out.
For larger tanks there are some amazing 3D backgrounds that are actually siliconed inside the tank (but I suspect this isn't what you have in mind).
Note: If it's a fish only tank, commercial backgrounds can add interest and realism. But plain (poster board - black or blue) or painted tends to be better for a planted tank as your focus is more on the plants than the background. An exception might be a commercial background of rock(s), serving as a backdrop for your plants.