Don't you just smile when you read Oscar Wilde? In any case, this excerpt from his great play The Importance of Being Earnest is a paradox.
In a paradox, someone says something that appears to be a contradiction, even a logical impossibility.
In this quotation, Wilde says that you have to be serious in order to have amusement. That sounds like a contradiction, even an impossibility. You have to be serious to have fun? Why?
Wilde's genius rests in his ability to craft lines like these, that make people laugh because they seem impossible (and because they are witty) but which also point us to deeper truths. People have to engaged seriously with the world, and really care about something, in order to find true satisfaction in life. That is both deeply true and profoundly ironic.