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.
Look at the shorter fence in the foreground. It looks like the space between the two fences is probably a line between the properties, and the neighbor did their fence backwards from what you're imagining, whereas the foreground fence is oriented the way you'd expect.
I had noticed that nobody in this thread seemed to notice that the neighbor's fence is facing the wrong direction. Most places, at least here in the US, will have some sort of code about your fence needing to show the more attractive, "outside" side facing away from the house.
I'm in the US. The fence is facing the normal direction. If there's any code saying it must face the other way (or any particular direction at all) then it's code specific to your community, or maybe your state. It's definitely not federal law.
I'm also in the US. The various jurisdictions that I have lived in have had regulations stating that the fence should have the more attractive side facing away from the home. So this would not be facing in the correct direction.
HOAs exist is a way toaintain shared services; i.e. insurances, utilities and roads, most importantly, but also things like clubhouses. Shit like this comes secondary.