Almost all of this was the result of a series of historical accidents, rather than a logically thought-out grand plan.
There are three different questions here.
1. Note names
Historically, letter names A - G were used for the note names of the medieval church modes. In the original system "B" represented the modern B flat.
The modes also required the note "B natural", which was first written as a different form of the letter B (a "square B", B quadratum for B natural and a "rounded B", B rotundum, for B flat). The "rotundum" shape evolved into the modern "flat" symbol and the "quadratum" into the modern natural.
An alternative naming system where the letter B was used for the modal note B flat, and H for B natural (which was a later addition to the original A-G naming system) still survives in some Germanic languages.
2. Keyboard layout
Early keyboards have not survived in their original form, since the "missing notes" made instruments obsolete, and they were either scrapped or modified to use a full chromatic scale. Some of the early keyboards had all 8 notes (A Bb B C ... G) on equal sized "white" keys. Others had a single "black key" for B flat.
By the time of Michael Praetorius's "Syntagma Musicum" (published in 1619) 12-note keyboards were "standard," but that book has details of several "incomplete" keyboards in the section on organ building. See vol 2, https://imslp.org/wiki/Special:ImagefromIndex/68476, starting at page 98 (page 126 of the PDF). A drawing on page 301 of the PDF shows an organ, originally built in 1361, with two 12-note keyboards arranged in an 8+4 layout, with B flat on an extra "white" key, and a third keyboard (added later) in the modern 7+5 layout.
3. Piano compass
The earliest "portable" keyboard instruments (i.e. not church organs) usually had a fairly small compass (4 octaves maximum), if only because small instruments were more portable that big ones. Early Italian harpsichords were typically "portable keyboards" built in plain oak-wood "flight cases" with a total weight of around 50 pounds - easy to carry between gigs on a donkey, or even on the player's back if necessary! The elaborate decorations that converted domestic keyboard instruments into status symbols for displaying the owner's wealth came later (and also provided a regular supply of work for Flemish artists like Rubens and his contemporaries!)
Some early keyboard instruments were built in pairs, tuned an octave (or sometimes a fifth) apart, and could be stacked on top of one another - rather like the "short keyboards" of some 20th-century electronic organs. The original compass was not very well defined in any case, since a full chromatic scale was rarely required for the lowest notes, and a keyboard that looks like "C C# D D# E F ..." might have actually been tuned to
"C A D Bb E F ..." or even "C G D A E F ..." where the G, A and Bb are in the octave below the "bottom C".
When the piano was first invented, the standard compass for the harpsichord was 5 octaves from F1 to F6 (C4 = middle C) which fitted nicely onto the "grand staff" without too many leger lines. The first pianos had the same compass. Extending this in both directions was a matter of improved mechanical engineering as well as pressure from musicians, and the modern 88 note compass was not practical until the development of a full iron frame and improved steel wire manufacturing, both of which date from the 1840s.
The 88-note compass of the piano is getting close to the limit of human hearing at the bass end (bottom A 27.5 Hz) and the practical limit of how short the strings and how small the soundboard can be at the treble end, unless the string material was changed from steel to something like carbon fibre - adding a few more notes that can only "plink" rather than produced a sustained "note" probably wouldn't have much musical value if the sound didn't match the rest of the instrument.