This is an excellent question! In principle any (hetero)polymer would work.
For context, in the short term we're targeting archival storage and not high speed storage (it'll probably never be low latency in the same way an SRAM is). The amazing thing about DNA is that it's not only long lived under reasonable storage conditions but also eternally relevant. Try reading a 30 year old 8" floppy today. The data may still be okay but you'll have trouble finding the hardware. Since DNA is so important to humans in other contexts (medicine), we can be fairly certain that DNA reading (sequencing) will be easy and available in 30 years, or 300, or 3000.
DNA is also much easier to manipulate. Nature provides us with all the tools (enzymes) we need to copy and select specific sequences. Academia provides us with a better understanding of DNA than other polymers. And industry provides us with wonderful machines like high throughput DNA sequencers. Watson-Crick base paring also allows DNA to do computation, which in some cases can be done directly on the data encoding DNA.
As for safety, you are right in that many microbes are quite good at finding and incorporating DNA but such an even would still be quite rare and there are many things to consider:
1) DNA data payloads are stored as just DNA, typically frozen or dried. And DNA alone is not sufficient to be pathogenic.
2) Generally when scientists store data in DNA right now it's encrypted first. This make it hard to pick out payload data that will encode for something specific.
3) It's far easier for a malicious person to just get parts of genes synthesized from different vendors and stitch them together at home. That ship has already sailed.
4) Currently the best way to synthesize the data payloads is in short sequences of DNA that aren't long enough to encode for anything but short peptides.
5) Randomly coming across a working pathogenic DNA sequence is technically possible but practically impossible (much like it's possible that you'll spontaneously quantum tunnel to the center of the earth but that'll never actually happen). An average gene in e. coli is about 8000 bases long. Of that size alone there are 4^(8000) (a beyond astronomically large number) of DNA sequences and only a handful of those do anything at all. Of those most would be toxic to the microbe it self or be a useless metabolic load (proteins are expensive to make and useless genes get cut out or turned off VERY fast in a population---days in continuous culture).
6) If desired, you can also trade off a little density to insert stop codons occasionally, limiting the size of anything translated to only a few amino acids.