Selmo's probably right. Tolkien created them so he probably thought he might as well pop them into the books as well, as they'd be as useful to the reader as to the writer - and hands up all those who have had a go at writing fantasy and have drawn up family trees. Heh, I bet most people have - along with that other staple, drawing a map (which is something else Bilbo liked).
Though it's not quite as poetic a reason for having them, I'll admit.
I happen to think Hobbits maintained records of ancestry mostly for purposes of determining inheritance, though that doesn't stop it from being a fascinating pastime to look up who they may be related to and so on...
However, genealogy was an important area of study for the upper classes, as lineage determined not just inheritance of fortunes but of
nations - take a look at the family trees descending from Edward III

And for those concerned with 'bloodlines' they determine pedigree, class and
breeding - look at Jane Austen's snootier characters like Lady Catherine De Bourgh.
These days genealogy is an absorbing pastime enjoyed by people from all sorts of backgrounds, and I like to think this is in part due to how families are now spread out on a national and global scale and yet people still like to have some sense of
roots, which they hope to find through searching their ancestry. I think in particular it affects those who live in 'colonised' countries like the USA and Canada as even though families may have been there for centuries, it's always intriguing to think of how/why they got there in the first place.
Would ordianry Elves
need to maintain family trees? After all, they could just go and ask their great-great-aunt, couldn't they?