In 1903, Erik Satie, an eccentric French composer, wrote 'Trois Morceaux en Forme de Poire,' which in English is 'Three Pieces in the Shape of a Pear'.

The rather odd title bears no obvious relationship to the sound of the music and was apparantly simply a response to Debussy's comment that Satie's work lacked form.

Nevertheless, where other compositions might specify "Play merrily and with gusto" or some other appropriate direction, the sheet music for 'Trois Morceaux en Forme de Poire' specifies "Play shaped like a pear." If you're not aware that Satie is essentially joking, then you are left thinking that 'pear shaped' is an extremely strange thing to demand of music. Thus the association is formed between 'pear shaped' and things that are strange or unexpected.

I believe this is the origin of the expression, as used today to mean 'wrong' or 'peculiar'.