pomander
I note the reference to Shakespeare's Love's Labour's Lost, originally flagged by Evan Morris over at The Word Detective and referenced by Callithumpian here. We are given to understand that Hector is given a gift, which is then described disparagingly as a 'lemon'. I think Morris is on to something, but it's more subtle than just a matter of 'sourness' as suggested above. Take the full exchange from Love's Labour's Lost (According to Pauline Kiernan in her 'Filthy Shakespeare', a play notorious for its word play):

*Arm. The armipotent Mars, of lances the mighty, Gave Hector a gift, -

Dum. A gift nutmeg

Biron. A lemon

Long. Stuck with cloves.

Dum. No cloven.*

Nutmegs in Shakespeare's time were astronomically high value items, and given as gifts. Sometimes this is written as a 'gilt' nutmeg. This doesn't change the essential context of Lord Dumaine's remark, he's referring to a high value item. Biron counters by suggesting that the gift is not a nutmeg, but a lemon. Shakespeare at this point is - I'd argue - not using 'lemon' as a metaphor for 'a sour surprise', but rather as a 'cheaper' substitute for the nutmeg. A lemon stuck with cloves (the sharp cloves 'stabbed' into the lemon skin) was a common New Year's gift, something that smelled pleasant and was said to ward off disease. It may also be a reference to the fruit of the nutmeg, which is not unlike a lemon. The rejoinder from Lord Dumaine, 'No, cloven' might be a coded reference to the tendency of the nutmeg fruit to split and reveal a bright red interior, a visual metaphor that I'll leave alone. I am inclined to the view that Shakespeare's relatively obscure reference has worked it's influence on the English usage of the term 'lemon' as a 'poorer substitute for the real thing', and that this usage has been reinforced over time by the association with the inherent sourness and bad taste of lemons.

(English Language & Usage): Why glemonh for a faulty or defective item?


FERDINAND
I think Hector was not so clean-timbered.
LONGAVILLE
His leg is too big for Hector's.
DUMAIN
More calf, certain.
BOYET
No; he is best endued in the small.
BIRON
This cannot be Hector.
DUMAIN
He's a god or a painter; for he makes faces.
DON
ADRIANO DE ARMADO
The armipotent Mars, of lances the almighty,
Gave Hector a gift,--
DUMAIN
A gilt nutmeg.
BIRON
A lemon.
LONGAVILLE
Stuck with cloves.
DUMAIN
No, cloven.
DON
ADRIANO DE ARMADO
Peace!--
The armipotent Mars, of lances the almighty
Gave Hector a gift, the heir of Ilion;
A man so breathed, that certain he would fight; yea
From morn till night, out of his pavilion.
I am that flower,--
DUMAIN
That mint.
LONGAVILLE
That columbine.
DON
ADRIANO DE ARMADO
Sweet Lord Longaville, rein thy tongue.
LONGAVILLE
I must rather give it the rein, for it runs against Hector.
DUMAIN
Ay, and Hector's a greyhound.
DON
ADRIANO DE ARMADO
The sweet war-man is dead and rotten; sweet chucks,
beat not the bones of the buried: when he breathed,
he was a man. But I will forward with my device.
To the PRINCESS
Sweet royalty, bestow on me the sense of hearing.
PRINCESS
Speak, brave Hector: we are much delighted.
DON