healpy write map only supports 2D arrays. Also Make sure that the number of pixels are valid. You can check back with npix2nside.