Your example is not just an arbitrary exercise. Without a doubt it was specifically designed to help train your fingers, but it does so in a practical way that demonstrates a possible real world use case.
Take a look at the second section. After the sixteenth note run, beginning on A with your 1st finger, you land on E with your 5th, exactly as written. Now imagine repeating the E 3 more times with your 5th before jumping up to play the G with your...5th? Ok, let's try repeating it twice with your 5th, then the last time with your 3rd, then jumping to G with your 5th...better, but still a little awkward. Instead we shift one finger at a time and when we need to get up to the G, our fingers are magically in the right place.
This becomes especially important when considering the Allegro tempo of the passage. Any other fingering will be awkward, clumsy and slow. Some might be workable, but this is likely the fastest and smoothest way to play it.
Changing fingers on the same repeated note (or even without releasing the note) happens quite often in advanced piano pieces (Chopin comes to mind). This exercise also provides a good way to practice this technique and get your fingers used to it. After the "same note, same finger" idea has been ingrained in you for so long, swapping fingers, especially in rapid succession (eg, Liszt, La Campanella) can feel really awkward.