Junk dna has many hypothetical reasons. First is that DNA virus dna if imbedded into the host dna won’t damage any genes. It’s also why you have many genes that repeat so that if one is damaged the other one works. Very sensitive genes like DNA polymerase and for ribosmaes have many many copies sparked through the entire genome.
Secondly it is believe although not very well understood in animals that dna and rna coding and non coding regions can form particular 3d shapes with itself. And while these confirmations can change depending on proteins and molecules added or removed from the strands, these 3d shapes and confirmations geometries are responsible for some of the singalling pathways in the body are responsible for activating or deactivating protein synthesis of certain genes. This 3d topology influinceing expression is believed to be influential in aging and as it relates to that is called the episome. Which means epigenetic (molecular additions or removals to the dna) dna conformational topology constraining signalling information. And for a simple understanding at how this all works in rna signalling check out riboswitches: topology in the rna message that signals to the ribosome or rna polymerase or reverse transcriptase to turn on or off and also controlling the spreed or transcription or translation for protein folding.