That’s likely because of the writings of influential Christian thinkers of the Middle Ages, such as St. Augustine and St. Thomas Aquinas. Their early writings helped develop the basic idea that “life is a gift given by God which should not be spurned”, and that suicide is against the “natural order” and interferes with God’s master plan for the world.

In Catholic and Orthodox doctrine, suicide is considered to be murder, and a violation of the commandment “Thou shalt not kill,”
These early churches would not even hold a burial service for a member that died by suicide, deeming it an act that condemned the person to hell, since they died in a state of mortal sin.
In the Medieval Times, the Christian church excommunicated or kicked people out of the church who attempted suicide and those who died by suicide were buried outside consecrated graveyards.
In some cases, the victims of suicide were dragged through the streets of the town and dismembered before being burned on the outskirts of town.
In Islam, the Holy Quran forbids suicide and states bluntly “Do not kill yourself”
In the Hindu religion, scriptures say that “one who dies by suicide will become part of the spirit world”, wandering earth until the time one would have otherwise died, had one not taken one’s own life.
Although there is no single concise religious view of suicide, generally, it is still considered a sin.