When and why did necromancy became a bad thing?
Probably since it was first practiced. However, there are no sources that ancient that have survived to our day. Some people would have been against it from day one because they would have thought it unholy and unnatural to the lest.
The oldest literary account of necromancy is found in Homer's (12th-8th century) Odyssey.
Necromancy is a practice of magic involving communication with the dead – either by summoning their spirits as apparitions, visions or raising them bodily – for the purpose of divination, imparting the means to foretell future events, discover hidden knowledge, to bring someone back from the dead, or to use the dead as a weapon. Sometimes referred to as "Death Magic", the term may also sometimes be used in a more general sense to refer to black magic or witchcraft.
The word necromancy is adapted from Late Latin necromantia, itself borrowed from post-Classical Greek νεκρομαντεία (nekromanteía), a compound of Ancient Greek νεκρός (nekrós), "dead body", and μαντεία (manteía), "divination by means of"; this compound form was first used by Origen of Alexandria in the 3rd century AD. The Classical Greek term was ἡ νέκυια (nekyia), from the episode of the Odyssey in which Odysseus visits the realm of the dead souls and νεκρομαντεία in Hellenistic Greek, rendered as necromantīa in Latin, and as necromancy in 17th-century English.
Early necromancy was related to – and most likely evolved from – shamanism, which calls upon spirits such as the ghosts of ancestors. Classical necromancers addressed the dead in "a mixture of high-pitch squeaking and low droning", comparable to the trance-state mutterings of shamans. Necromancy was prevalent throughout Western antiquity with records of its practice in ancient Egypt, Babylonia, Greece and Rome. In his Geographica, Strabo refers to νεκρομαντία (nekromantia), or "diviners by the dead", as the foremost practitioners of divination among the people of Persia, and it is believed to have also been widespread among the peoples of Chaldea (particularly the Sabians, or "star-worshipers"), Etruria and Babylonia. The Babylonian necromancers were called manzazuu or sha'etemmu, and the spirits they raised were called etemmu.
The oldest literary account of necromancy is found in Homer’s Odyssey. Under the direction of Circe, a powerful sorceress, Odysseus travels to the underworld (katabasis) in order to gain insight about his impending voyage home by raising the spirits of the dead through the use of spells which Circe has taught him. He wishes to invoke and question the shade of Tiresias in particular; however, he is unable to summon the seer's spirit without the assistance of others. The Odyssey's passages contain many descriptive references to necromantic rituals: rites must be performed around a pit with fire during nocturnal hours, and Odysseus has to follow a specific recipe, which includes the blood of sacrificial animals, to concoct a libation for the ghosts to drink while he recites prayers to both the ghosts and gods of the underworld.
Biblical writing are very explicit that necromancy is wrong and is punishable by death.
10 Let no one be found among you who sacrifices their son or daughter in the fire, who practices divination or sorcery, interprets omens, engages in witchcraft, 11 or casts spells, or who is a medium or spiritist or who consults the dead. 12 Anyone who does these things is detestable to the Lord; because of these same detestable practices the Lord your God will drive out those nations before you. - Deuteronomy 18:10-12
The Book of Deuteronomy is believed to have been written by Moses the Lawgiver himself sometime in mid to late 13th century BC.