Reactionaries are always doing this
The origin of the tales is unknown. The archetype may contain elements derived from the 12th-century pagan Cuman-Kipchak (Polovtsian) leader Khan Konchak, who is recorded in The Tale of Igor's Campaign; over time a balanced view of the non-Christian Cuman khan may have been distorted or caricatured by Christian Slavic writers.
The legendary miserliness (love of gold) of Koschei is speculated to be a distorted record of Konchak's role as the keeper of the Kosh's resources.
Koschei's epithet "the immortal" may be a reference to Konchak's longevity. He is last recorded in Russian chronicles during the 1203 capture of Kiev, if the record is correct this gives Konchak an unusually long life – possibly over 100 years – for the time this would have been over six generations.
It is thought that many of the negative aspects of Koschei's character are distortions of a more nuanced relationship of Khan Konchak with the Christian Slavs, such as his rescuing of Prince Igor from captivity, or the marriage between Igor's son and Konchak's daughter. Konchak, as a pagan, could have been demonised over time as a stereotypical villain.