An obvious suggestion would be the Mass in B Minor, which is Bach's greatest symphonic work. As someone already suggested, the Agnus Dei, an Alto solo, is a very good piece for funeral music.
On the other hand, I would recomend several other pieces that are less known, keyboard works that recieve less attention. One would be the French Overture, also in B Minor, particularly the Sarabande, which is a slow baroque dance. Next, the Capriccio in B Flat (which is subtitled 'sopra la Lontananza del suo Fratello Dilettissimo' or 'on the loss of a beloved brother'). Specifically in this work, consider the third movement (Adagissimo), which uses chromatic and minor harmonies to throw up a very sad atmosphere.
Also listen to the eighth prelude and fugue of the first book of the Well-Tempered Klavier; the 16th prelude of the same book; 22nd and 24th preludes from the second book; the second movement of the Italian Concerto; the fifteenth and twenty-first variations of the Goldberg Variations; and perhaps even the Aria of the Goldberg Variations.
On a more personal note, I have always intended that there will be no glumness at my funeral. I would understand if your departed would rather not have such gloomy works as the ones I have listed and the ones that most people will likely list. So, on a brighter note;
The rest of the Goldberg Variations, particularly the Aria.
The Duets for keyboard.
The Choral Preludes for organ.
The English Suites.
The major-key pieces of the Well-Tempered Klavier (Book One: Prelude #1, Prelude #5, Prelude #19, Prelude #21. Book Two: Prelude #3, Prelude #7, Prelude #11, Prelude #15.)