Etymology of "horny"
Solution 1:
Horn is slang for the male erection, based on its shape - and horny is a derivative of that.
The OED has this definition for the slang sense of horn:
An erect penis; an erection. Also in phr. to have (also get) the horn: to be sexually excited. (Not in polite use.)
The earliest two citations in the OED are:
1785 F. Grose Classical Dict. Vulgar Tongue Horn Cholick, a temporary priapism.
1879–80 Pearl (1970) 257 A man with light trousers, of decency shorn, Stop and talk to young ladies while having the horn.
According to the OED, horny originally meant "consisting of horn" (citations from 1398 onwards), later "Callous or hardened so as to be horn-like in texture" (1693). Then in 1889 it was first attested with this meaning:
Sexually excited; lecherous. (Chiefly used of a man.) Cf. horn n. 5c. slang.
(Horn 5c is the definition of horn that I've cited above.)
Green's Dictionary of Slang gives the following etymology for horn:
[resemblance to an SE horn]
(where SE means "standard English" according to his list of abbreviations).
And for "horny", his etymology simply refers us back to that definition of "horn" and hence that etymology.
Solution 2:
horny (adj.) "lustful, sexually aroused," definitely in use 1889, perhaps attested as early as 1863; from late 18c. slang expression to have the horn, suggestive of male sexual excitement (but eventually applied to women as well); see horn (n.).
Online Etymology Dictionary
There doesn't seem much more to say - it's a pretty obvious metaphor.
Solution 3:
Perhaps "horn" is a slang word for the male member in a state of excitement and, by analogy, "horny" meaning having a woody?
Solution 4:
Something I remember reading a long time ago on Google Books: The Words of the Day. The Unlikely Evolution of Common English by Steven M. Cerutti, Ph.D.
Horny is apparently an allusion to the horned Egyptian god Amun or Ammon, who was in charge of, among other things, virility and procreation. The Wikipedia page has some graphic images attesting the very same.
From Wikipedia
Several words derive from Amun via the Greek form, Ammon, such as ammonia and ammonite. The Romans called the ammonium chloride they collected from deposits near the Temple of Jupiter-Amun in ancient Libya sal ammoniacus (salt of Amun) because of proximity to the nearby temple. Ammonia, as well as being the chemical, is a genus name in the foraminifera. Both these foraminiferans (shelled Protozoa) and ammonites (extinct shelled cephalopods) bear spiral shells resembling a ram's, and Ammon's, horns. The regions of the hippocampus in the brain are called the cornu ammonis – literally "Amun's Horns", due to the horned appearance of the dark and light bands of cellular layers.