Does an illegal mode of creation or fixation (such as vandalism by graffiti) mean that the work is not the subject of copyright?
The Copyright Act provides that (17 U.S.C. § 102):
Copyright protection subsists, in accordance with this title, in original works of authorship fixed1 in any tangible medium of expression, now known or later developed, from which they can be perceived, reproduced, or otherwise communicated, either directly or with the aid of a machine or device.
It also says:
In no case does copyright protection for an original work of authorship extend to any idea, procedure, process, system, method of operation, concept, principle, or discovery, regardless of the form in which it is described, explained, illustrated, or embodied in such work.
There is no explicit requirement that the work be legally produced, and there is no exception for copyright protection if the work is illegally produced.
See also Celia Lerman, "Protecting Artistic Vandalism: Graffiti and Copyright Law" (2013) 2 N.Y.U. J. Intellectual Property and Entertainment Law 295:
there are several examples outside of graffiti where copyright protects right-infringing works. Copyright still attaches to photographs taken that violate privacy rights: a paparazzi photographer has obtained copyright protection over a picture that he took of a celebrity while violating her rights to privacy, and a camp counsellor obtained copyright over a picture of a minor, taken without her parent's permission. A journalist has received copyright protection over an article that reveals state secrets. A student may obtain copyright protection for a painting of a minor killing a policeman, even though the work could constitute an illegal threat under criminal law.
Copyright protection is denied to a work only if the work itself violates copyright. ...
If U.S. copyright law included a general "illegality clause," then copyright would not protect works that offend any other body of law. Such clauses are contained in other copyright and trademark laws around the world. U.S. copyright law does not include such a provision. ...
[a vandal's] work can still be protected under copyright, because vandalism does not preclude copyright protection.
1. § 101: "A work is 'fixed' in a tangible medium of expression when its embodiment in a copy or phonorecord, by or under the authority of the author, is sufficiently permanent or stable to permit it to be perceived, reproduced, or otherwise communicated for a period of more than transitory duration."