Why does "groove" mean "take pleasure in"?
The term groove, meaning to take pleasure in, probably comes from the term in the groove used by jazz musicians, as early as the 1930s. Etymonline says that the adjective groovy (1937) and the slang verb to groove (late 1930s1) originated with this expression.
This was defined in the book Swing That Music, by Louis Armstrong and Horace Gerlach (1936):
IN THE GROOVE : When carried away or inspired by the music, when playing in exalted spirit and to perfection.
The earliest I can find this usage in Google Books is from 1932:
These two have magnificent swing, the rhythm is in-the-groove all the way and the solos, especially clarinet and trombone, are strictly up to par.
which is also about jazz, although note that this time it's just the rhythm which is in the groove.
Where does this expression come from? It seems that "in the groove" may have been used before this, meaning that you were repeatedly doing the same thing, but (unlike "in a rut") in a positive sense. This snippet comes from the Journal of American Insurance from 1928:
"… I envy you the pep you have brought back with you. Pity me if you like; I have had no vacation," I answered him.
"Not at all," replied he. "You are in the groove, and running smoothly".
(Note that since this use isn't that much earlier, it might have come from the musical sense, and just been written down sooner.)
1 the verb "to groove", meaning "to make grooves in", is much older.
The edison phonograph was invented in 1877. By 1902, the phonograph industry was growing quickly--over a hundred thousand edison phonographs and 5 million edison-format records had been produced (Leonard DeGraaf, Confronting the Mass Market: Thomas Edison and the Entertainment Phonograph, Business and Economic History Vol. 24 (Fall 1995):89-90), and the word "groove" was being used for recordings (http://www.etymonline.com/index.php?term=groove, accessed 20140212).
As the phonograph became more familiar to the general public in the early 20th century, the average person would have been increasingly aware of records, and what a record sounded like when it was not in the groove--sudden and dissonant--and consider that early "talking" movies often had the audio track playing on a phonograph. The audio joke that is the sound of a skipping or scratching record persists even today in an era when vinyl records are a niche market.
As such, it is conjecture, but a plausible one, that "in the groove" was adopted linguistically to represent the antithesis of this dissonance.