As long as a fence doesn't pose a threat of harm to neighbors or those passing by, it probably doesn't violate any law just because it's ugly. Occasionally, however, a town or subdivision allows only certain types of new fences -- such as board fences -- in an attempt to create a harmonious architectural look. Some towns also prohibit certain materials -- for example, electrically charged or barbed wire fences.
Even without such a specific law, if a fence is so poorly constructed that it is an eyesore or a danger, it may be prohibited by another law, such as a blighted property ordinance. And if the fence was erected just for meanness -- it's high, ugly and has no reasonable use to the owner -- it may be a "spite fence," and you can sue the neighbor to get it torn down.