My understanding is: Initially it got it's name ("junk DNA") because it is not encoding proteins. But in the mean time we have long found out that it is nonetheless encoding vital information, like transcription factors, promotors, etc.! Hence, it's usually called non coding DNA now.