So, how did the keyboard layouts develop historically?
Did you have a look at https://en.wikipedia.org/wiki/AZERTY#History and https://en.wikipedia.org/wiki/QWERTY ?
In the beginning, there was not a keyboard layout. Each keyboard manufacturer. In fact, early Sholes typewriters had the keys arranged alphabetically. Trying to solve a jamming problem (and probably also based on letters frequency and users’s feedback) is how the initial QWERTY layout was born. The success of the Remington No. 2 of 1878 made this very popular.
AZERTY (just like QWERTZ or QZERTY) is basically a QWERTY variation adapted for a given language (based on the assumption that it would be better to type a given language if certain letters that are very frequent on them appear on the home row).
Why haven’t France and Belgium reformed this redundancy by using the QWERTY keyboard instead of the AZERTY keyboard?
Why should they use QWERTY? Do note that it isn’t an optimal keyboard layout, either. Why aren’t you -I assume- using QWERTY and not DVORAK?
There are lots and lots of users that learnt to type in AZERTY. There would be an high cost of changing to a different layout. Plus, there are lots and lots of physical keyboards in those places showing an AZERTY layout.
There is a cost of switching to something else. In fact, a BEPO layout would be preferable from a theorical point of view. However, it would be costly for users to retrain themselves into a different layout. And with most computers in the country using AZERTY, that would put them in a disadvantage when using a different computer. This makes them to continue using AZERTY. Just like other countries continue using QWERTY.
Note: there was recently a keyboard layout standardization by French AFNOR (NF Z71‐300), but it kept the position of AZERTY letters, see https://norme-azerty.fr/ (there was an accompanying BEPO layout, too)