Since American football evolved partly from rugby 1, 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.