What the Mafia was supposed to be and what it was are two radically different things. It is generally accepted that the genesis of the "Men of Respect" came in post feudal Sicily when land ownership was taken from the nobility and opened up to the private citizens.

Many newly prosperous landowners found the need to hire men to protect their property during the turbulent transition period that followed. Soon protection became "protection".
within a few years,the newly invigorated economy became a source of money and power for the "Friends".
The real boom came in urban areas such as Palermo.
With so many more farms,ranches,citrus groves,etc.being operated by the new citizen class of owners, new opportunities for crime arose.

Landowners were pressured into hiring men with connections to the Mafia,voting to support candidates that were Mafia friendly (or Mafia themselves),and of course,paying protection. There are accounts of Mafiosi engaging in smuggling,counterfeiting,and various other crimes. This all occurred in the latter half of the nineteenth century.

At some very early point, the Mafia may have been a semi-noble concept,but it took a very divergent path very quickly. Organized crime groups (of any ethnicity),start by preying on their own.The term "Men of Respect" was used by Mafiosi themselves when referring to each other,and I doubt that it was ever used by their victims.