The clown (also referrred to as Feste) is Olivia's professional jester, or fool. During the Renaissance, monarchs and sometimes members of the nobility retained fools in their households as a source of entertainment—to sing, make witty observations, and to engage in practical jokes.
To a certain extent—and true to his profession—Feste contributes to the holiday tone of Twelfth Night.
Feste has also been referred to as the only character in Twelfth Night who remains detached from the play's conflicts, thus being able to comment objectively on the other characters' actions and shortcomings.
For a more detailed character analysis, check out the link on eNotes below.