The word distance is meaningful in both an uncountable sense and a countable sense. So, the type of determiner (or lack of any determiner) that you precede it with, or whether you use the plural, indicates how you want the listener to understand it.
First, here is uncountable distance:
Let's put some distance between us and Houston. [That is, let's drive away from Houston.]
The force of gravity is inversely proportional to the square of distance.
It wouldn't make sense to put "distances" in either of those sentences.
The countable sense of distance is any specific distance, like 2.1 meters, 20 miles, or 3 inches. You can count these:
This star map shows the distances from Earth to 2,000 different stars. [The distance from Earth to Alpha Centauri, the distance from Earth to Sirius, the distance from Earth to Polaris, etc.]
My first day on the job as a surveyor, I measured 47 distances.
No one would really say the second one, but it does make sense.
Once you understand countable distance, then you can understand common expressions like at a distance and a distance.
I watched the battlefield from a safe distance. [The distance between me and the battlefield was great enough that the bullets couldn't reach me.]
The arc of a baseball in flight isn't caused by a force that Earth exerts on the ball at a distance, as Newton's theory held. Instead, the ball is responding to the gravitational field immediately around it. [Source: Spooky Action At a Distance (2015). Action at a distance is direct causal influence by one object on another object that is spatially separated from it. In other words, there is a non-zero distance between the objects.]
Please keep your dog at a distance. [Please keep your dog far enough away from me that I don't need to fear getting bitten.]
These countable uses of distance don't specify a distance numerically. They refer inexactly to a distance: whatever is far enough for the purpose under discussion, even if only implicitly, as in the sentence about the dog. However, it would be strange to put "distance" into the plural in any of these last three sentences.
The same applies to other uncountable nouns whose meaning can reasonably be seen in a countable way. You can put an indefinite article in front of them or put them in the plural to lead the reader to understand them in a countable sense, the exact meaning determined by context and custom:
When a woman is past a certain age, you no longer ask her her age.
Did an alien intelligence probe planet Earth in 1954?
The strengths of the wrestlers were so unequal, there was never any doubt who would win the match.
Once upon a time, there was a President Pro Tempore who presided over the Senate for a time, that is, until the Vice President returned. [The first "a time" denotes a certain moment in (fictional) past time; the second "a time" denotes a certain time interval.]
During the low-water season of each year, the rock reef, acting as a natural barrier, caused a substantial part of the water of Fall River to flow upstream into Pitville Pool. During floods, the waters of the two rivers flowed over the reef, leaving very little of Fall River impounded in the pool. [Source: Water Rights Laws in the Nineteen Western States (1974). Plural "waters" often refers to turbulent water on a large scale, as in a flood or where rivers meet.]
Social and economic pressures often drive professionals to become blind to elements of their field of expertise that are obvious to outsiders, e.g. economists who don't see that people choose jobs for reasons other than salary or linguists who deny that sentences communicate thoughts.
There is no general rule about what is correct, beyond what you can reasonably expect a reader to understand and what phrases involving the noun have meanings well established by previous usage.