To make money, and it worked. Mario was created by Shigeru Miyamoto at Nintendo in the early 1980s for Donkey Kong, an arcade game built because the company needed a hit in the North American market. The character was originally called Jumpman, and was renamed after Nintendo's landlord in the US warehouse, Mario Segale.
Entertainment was the product. What nobody anticipated was that the character would go on to become the most recognisable figure in the medium.