The buttons, it turns out, do more than add an industrial chic look to jeans. They're much more functional than that teeny little pocket you can't fit anything in (once upon time, people could fit things in there, but that purpose is now obsolete). The buttons—which are actually called rivets—were patented back in 1873 by Jacob Davis for Levi Strauss & Co.
The central part of Davis's patent reads as such (prepare for some fancy language):
My invention relates to a fastening for pocket-openings, whereby; the sewed seams are prevented from ripping or starting from frequent pressure or strain thereon; and it consists in the employment of a metal rivet or eyelet at each edge of the pocket-opening, to prevent the ripping of the seam at those points. The rivet or eyelet is so fastened in the seam as to bind the two parts of cloth which the seam unites together, so that it shall prevent the strain or pressure from coming upon the thread with which the seam is sewed.
Translation: those cumbersome little button-things help hold together the seams of your pants and ensure that your waistline doesn't rip 'em apart Hulk-style.
Levi Strauss knew what he was doing, because Levis are still cool, and now most jeans have those buttons—sorry, rivets.