Presumably the fence runs between their property so they have to see it every day. Also those exposed nails could be hazardous to pets or children.
It's also pretty trivial to cut the boards to length and use appropriate fasteners. Maybe I'm reading too much into this, but I suspect this kind of carelessness is present in other parts of the neighbor's life. They've probably gotten on OP's nerves before.