People who study music theory love to know the history behind the concepts, terms, and instruments. The credit for creating the first primitive keyboard goes to Ktesibios of Greece in 300 B.C., who invented the one-note pipe organ.
Romans adopted the design later for use in their arenas because it was the loudest instrument in existence and was perfectly suited to herald the beginning and end of the Roman Games. It probably wasn’t a very popular instrument for anyone but Roman aristocracy, since anyone else who heard it played was probably in the arena about to face an angry tiger.
Since the late 700s, pipe organs were a fixture in the Catholic Church, but played only when whatever pope was presiding considered it appropriate. St. Augustine was apparently uncomfortable with music and did not allow it to be played during services, while Pope Gregory forbade priests from playing musical instruments and allowed compositions using the human voice to be performed only during services.
One rarely saw a keyboard used outside of church, so there were no keyboards for folk musicians to experiment on. Pipe organs were way too large to steal, so if a church was attacked and razed, the organ went down right along with it.
Because of its church affiliation, organs (and therefore keyboards) were considered too sacred an instrument for ordinary people to learn to play. When the harpsichord became available for public consumption in the 15th century, it was almost immediately considered a far superior instrument than the stringed “peasant instruments” that had been around for millennia. This perception of the keyboard instrument belonging to a superior class carried on into the Baroque and Classical periods of music, and into public perception even today.
One major advantage a keyboard has over other instruments for composers is that because so many notes are available on a keyboard and those notes can be played simultaneously, a composer can easily compose a score that can be divided up among multiple instruments. Because of this, the keyboard takes a major role in helping invent modern musical notation.