Slate has an interesting article up on the use of bagpipes (specifically of the Highland variety) at military funerals, occasioned by the recent tragedy at Fort Hood.
According to the article, it isn't that pipes are particularly common at military funerals--they're common at funerals in general, sometimes just for aesthetic reasons, and sometimes because of a family connection to Scotland or Ireland.
It's also interesting to note that there isn't really anything particularly Scottish about bagpipes. As this list shows, bagpipes were a pretty common folk instrument throughout Europe and the Middle East, especially in the medieval period. In modern times, they've come to be associated with Scotland, and most of the older varieties have died out or been replaced by the Great Highland Pipes (best for sheer volume, and what most people in the US mean when they say "bagpipes") and the Irish uilleann pipes (best for range and precision).
Anyway, go and read the article--it's worth a look. And the Jacobites make a cameo! As if you haven't already heard enough of him here, here, here, and again, in a few days, when we get around to posting about Lindisfarne Castle.