Miles is plural. (But we say 0.5 miles and not 1\2 mile, we say 1\2 a mile. Even though they are mathematically the same quantity. Because while saying “half a mile” or “quarter of a mile” we are referring to the quantity “one mile” first.)
We do say
It is miles to the next gas station.
because here, “is” refers to the object “gas station” and not miles.
Now while expressing conversions, even if it were kilometers we would say, 10 kms is 10,000 meters. But that doesn’t make it any less plural. Because “10 kms” here is being treated as one unit. E.g.: “10 miles is a long way to go” here as well “10 miles “ is being treated as one unit, “X is a long way to go”. Hence under such circumstances we tend to use “is”. In many other cases as well,
5 apples is all I need.
10 cases of wine should do.