>>12256367if you're really referring to junk DNA and not merely non-coding (i.e. regulatory elements), it's generally leftover transposons, tandem repeats/microsatellites (which can be extended by DNA slip-rep, etc), vestigial genes no longer in use, other aspects. Of these, repeats are the least "junk" because they sometimes serve a purpose, sometimes don't. They serve an artificial purpose for identification, paternity tests (CODIS), stuff like that, but most often they are junk, it's just that there are exceptions (spacers come to mind). There's plenty of DNA that serves a purpose in early development and subsequently gets "shut off" by either methylation or histone deacetylation to condense into heterochromatin.
There's an important aspect you're missing, however. "Junk" DNA is great because it decreases the chance that a deletion or other disruption will affect more important DNA. this becomes a bigger deal when you consider certain cancers. If you get a mutation in a non-coding, nonfunctional repeat, that's much better than, say, a mutation resulting in a constitutively active kinase. If you catch my (genetic) drift, har har