2 b) Indeed, according to a pure utilitarian calculus a necrophile committing the act in the privacy of his own home without anyone knowing is making the world a better place by increasing his own happiness while not affecting the happiness of any other person.
I have mixed feelings on the legality of necrophilia, but this could be analogous for a man to put a camera in a woman's shower if he were sure she (or anyone else) would never find out. That would still be considered a violation of the wishes of the woman. Not saying this is totally analogous because one is alive is the other is dead.