Since American football evolved partly from rugby1, it's no surprise that their shapes are similar.
The main reason for the oblong shape is to allow carrying the ball by hand. A round ball kicks very well indeed, but is very easy to knock away; an oblong ball is still effective to kick and is much easier to grip.
American footballs kept the same basic shape but added laces and pointed ends because both features make the ball easier to throw. Rugby, of course, needs neither feature.
1 See Wikipedia's History of American Football. Ironically, the first American football game that used an oblong ball and allowed carrying was Harvard vs. McGill, a Canadian university.