Mechanically, they needed a d8 finesse weapon. Thematically, they wanted to include it as more of swashbuckling weapon. D&D has gradually moved out of GG's obsession with medieval poll-arms and tried to incorporate more eras and styles in an attempt to appeal to a broader base. Heck, a lot of the art for recent projects looks like something out of a Victorian Steam-punk/Sherlock Holmes adventure. I remember when 3e came out and rapiers were added to the core rule books for the first team people complaining about 'Zorro' or the 'Three Musketeers' in D&D.
Practically speaking rapiers were long, sharp and deadly weapons, not the fencing implements most casual players may think of when the term is mentioned. About as practical as most other D&D weapons when facing a dragon (which is to say not very practical).