The new legislation marks the culmination of a two-year drive to outlaw necrophilia in the state and will help prosecutors who have been stymied by the lack of an official ban on the practice, according to experts.