Not all deities of course, just specific ones like Krishna, Vishnu, etc.
This is a very interesting and frequently asked question about Hinduism, and while there isn't a definitive answer to it, I will lay out certain facts and analysis regarding Krishna that may explain why many Hindu deities are often depicted with dark blue skin.
Later in the 4th century CE, the pastoral tradition of Bal Gopal, with its lively and joyful stories of a mischievous child deity, was absorbed into the Krishna tradition. Hence we get the impression of an unbroken Krishna story, from childhood to adolescence to manhood, but it's more likely a synthesis of various traditions and folk stories.
In the pastoral tradition, Krishna is depicted as a young, mischievous child deity who plays a flute with magical effects, luring the innocent and the heedless from the certainties of an well-ordered society. He also invariably wears peacock feathers in his crown, which are suggestive of a forest.
Based on these three points, it can be argued that Krishna's dark blue skin is indicative of his non-Aryan, tribal origin. But as I said at the start, there's no definitive answer to the question, so I could very well be wrong. But if the explanation is correct, that would also explain why other deities, such as Rama, Shiva and Kali, are also depicted in a similar manner.
Sources:-
Amalgamation of various traditions:
Pradyumna: Lover, Magician, and Son of the Avatara, Christopher R. Austin, 2019, Oxford University Press, pg. 23
Kaladarsana: American Studies in the Art of India, Joanna Gottfried Williams, 1981, BRILL, pg. 127-131
Pastoral tradition and possibility of non-Aryan origin:
A Survey of Hinduism, Klaus K. Klostermaier, 2005, State University of New York Press, pg. 206
Hindu Art, T. Richard Blurton, 1993, Harvard University Press, pg. 133-134