The verse in Bereishis 3:1 reads:
וְהַנָּחָשׁ֙ הָיָ֣ה עָר֔וּם מִכֹּל֙ חַיַּ֣ת הַשָּׂדֶ֔ה אֲשֶׁ֥ר עָשָׂ֖ה יְהוָ֣ה אֱלֹהִ֑ים וַיֹּ֙אמֶר֙ אֶל־הָ֣אִשָּׁ֔ה אַ֚ף כִּֽי־אָמַ֣ר אֱלֹהִ֔ים לֹ֣א תֹֽאכְל֔וּ מִכֹּ֖ל עֵ֥ץ הַגָּֽן׃
Now the serpent was the shrewdest of all the wild beasts that the LORD God had made. He said to the woman, “Did God really say: You shall not eat of any tree of the garden?”
Interestingly, the Provencal Rabbi, biblical commentator, grammarian and philosopher, Radak (Rabbi Dovid Kimche) makes the following grammatical analysis here and notes a difference in the two words which is why they have separate meanings:
היה ערום - clever: Seeing that the word refers to intelligence, it is spelled with the vowel shuruk to distinguish it from the adjective arum naked, which is spelled with the vowel cholam. [in our editions of the Torah both words are spelled with the letter shuruk representing the vowel shuruk. Ed.] Seeing the word occurs in the plural, the letter מ does not have a dagesh, compare מחשבות ערומים in Job 5:12 where it means :“the designs of the crafty ones.” When the word is used to described nudity, the letter מ is written with a dagesh. Compare Job 22:6 ובגדי ערומים תפשיט, “You leave them stripped of their clothing.” When the Torah wrote here היה ערום, it meant that the serpent possessed extraordinary powers of imagination, totally superior to other animals in this respect. Our sages generally describe the fox as crafty, able to scheme, something other animals are not credited with doing. (Berachot 61) This is not the same as possessing didactic intelligence, something reserved for man. When the Torah adds the words מכל חית השדה, it excludes the domestic animals, בהמות as not possessing even a modicum of such powers of imagination, The serpent at that time was superior to the fox in its ability to scheme. אשר עשה ה' אלוקים, even though all these creatures had been constructed out of the same raw material, G-d had given added an advantage to different ones of these creatures. Some had been granted greater physical prowess, others greater power to scheme.
(Sefaria translation)