A court has heard how a drug user daubed “shocking and alarming” Nazi graffiti in the block of flats where he lived.