90% of our genome is unconserved, meaning that it is not under selection. Most of this consists of dead viruses and mobile elements. Such DNA was present for its own purposes while it was active but is long since dead. A tiny proportion of this junk is later co-opted by the host organism.
The null hypothesis is that junk DNA is junk. It survives in the genomes of species with small effective population size because its selection coefficient is too small for it to be purged.
The alternative hypothesis you gave would need evidence to support it, otherwise it's another 'just so' story. Ask yourself, if this junk is beneficial for adaptation as you hypothesize, why don't bacteria have any? More broadly, why is the amount of junk DNA indirectly proportional to the effective population size (as the null hypothesis predicts)?