The Duke and Duchess are basically a couple of pranksters with too much time on their hands.
They take so much joy in manipulating others, in fact, that they are almost crazy themselves. As the narrator notes, "[The] Duke and Duchess were within a hair's breadth of being though fools themselves, for taking so much pains to make sport with the weakness of two poor silly wretches" (184.108.40.206).
On the border between sanity and insanity? Well, well. These folks will fit right in.
The Duke and Duchess are insanely elaborate when it comes to their pranks, investing a ton of time, money, and manpower into making them happen. Maybe that's what comes of a life of idleness. Or maybe it's not so bad to spice up your life with some imagination?
Some good actually does come out of the Duke and Duchess's pranks. Sancho, for example, gets to become governor of a town for a short while before learning that life will be better if he just knows his place. On the other hand, every prank the Duke and Duchess pull seems to involve some sort of physical pain for Sancho, whether it's the bum-whipping he has to take for Dulcinea's curse or the beard-pulling he needs to take to wake the dead Altisidora. It's not totally clear if Cervantes wants us to worry about Sancho, but it's something to think about.
For all of their love of jokes, the Duke and Duchess are also surprisingly stern. For example, at one point in the novel, we're left thinking that the Duke will let his servant Tosilos marry his other servant's daughter. But when we meet Tosilos later in the book, we learn that he "was sadly disappointed; for when you were gone, my Lord Duke had me soundly banged, for not doing as he ordered me in that matter" (220.127.116.11).
This is not the first evidence we see of the Duke's fiery temper. We learn earlier in the book that he gets very angry with his servants when they try to make fun of Don Quixote without his permission. On top of that, we learn that the Duchess isn't afraid to hit and pinch her servants herself if they disobey her, as she does to her lady-in-waiting Doña Rodriguez at the end of Part 2, Book 1, Chapter 48: "[she held] her by the throat, and squeeze[d] her weasand [throat] so hard, that it was not in her power to cry out" (18.104.22.168).
It can be hard to tell what to make of the Duke and Duchess. Like everyone else in the novel, they're a mixture of good and bad, and we're left to make our own judgments. All we know is that we certainly like a good laugh just as much as this duo does. When we laugh at Don Quixote's antics, we're laughing with them.