The Merovingian has a very specific objective. He wants "The Eyes of the Oracle" (literally her eyes but more figuratively the code that allows her to predict the future) and is holding onto the Keymaker as a bargaining chip, hoping to get the Zionese Rebels to do his dirty work in convincing her to hand them over, something that she might finally be willing to do given how close the Matrix is to collapsing.
Merovingian: Huh, huuuh. Always straight to business, eh Morpheus? Okay. I have something you want. To make a deal, you must
have something I want. Yes? It so happens there is something I want.
Something I've wanted ever since I first came here. It's said it
cannot be taken. It can only be given.
Morpheus: What?
Merovingian: The eyes of the Oracle. [laughs] I have told you before there is no escaping the nature of the universe. It is that
nature that has again brought you to me. Where some see coincidence, I
see consequence. Where others see chance, I see cause. Bring me the
eyes of the Oracle and I will give you back your savior. It seems a
perfectly fair and manageable deal to me. Yes? No?
And while it's certainly true that a catastrophic collapse of the Matrix would damage him, he's evidently willing to take that risk, noting of course that it wouldn't result in his destruction as he has his own route in and out of the Matrix into the Machine World.