From answers.com:
"Mafia" was the name of a specific society in Sicily, yet the word itself has no pin-pointed historical birthplace. In the original Palermo dialect the word 'mafioso' once meant "beautiful", "bold" or "self-confident". Anyone who was worthy of being described as a mafioso therefore had a certain something, an attribute called "mafia". "Cool" is about the closest modern English equivalent; a mafioso was someone who fancied himself. The criminal connotation to the word was attached after the set up of the play I Mafiusi di la Vicaria (The Mafiosos of Vicaria Prison) in Palermo 1863, by Giuseppi Rizzottu and Gaetanu Mosca. In the play, the name mafia is never mentioned, but with the word "Mafiusi" in the title and the play being about criminal sects and organized gangs clearly made a new connotation to the noun "Mafia". The adjective form: "Mafiusi" in the title was probably just put there to add local flavor so the play would be popular with the local population.