This is Danvers State Insane Asylum, the inspiration for H.P. Lovecraft's Arkham Sanitarium "which in turn was the inspiration for Arkham Asylum in the Batman comic book series". Today, the building is part of Avalon Danvers, a pleasant residential community.
Right now, those buildings stand surrounded by a swimming pool, fitness centre, basketball court, and whatever other amenities an apartment community might have:
Still spooky looking, no? Doesn't seem surprising that there's been all sorts of supernatural activity reported by residents and visitors.