Screw it to the wall. A typical vanity has a wood strip along the upper back. Run some screws through the strip into the studs in the wall.
Do not use long screws. You run the risk of screwing a long screw into a pipe in the wall.
I might be wrong, but I'm "Picturing" (hint-hint) that you have a Regular T which has both drains aligned with each other & gravity's supposed to drop the water down the drain that's perfectly in the middle of both sinks. Like this.
This might be what was previously there & was fine. But, did you change anything like the vertical heights of anything? However, this is actually the wrong setup & allows for a lot of debris build-up & sometimes very poor draining.
-
The correct setup is to actually connect to the P-trap off to one side & straight down from one of the sinks. Then you turn your T side ways (but preferably a WYE fitting...see last picture) to accept a long pipe from the other sink.
-
Here's the best setup, using a WYE. See how the fitting starts the gravity drop.
-
Anyway, I do realize this is likely an Off-The-Shelf Kit & you won't be doing any of the above permanent type of setups. But, stoppers shouldn't be the problem if water's normally exiting the sink. I would take another look around the store & ask about other or better double sink kits. Or, even see if they can help you screw one together of individual parts.
I think you just need to either match exactly what you had before or get a better kit & even a different kit if another setup can work under your sinks. I have run into your problem a number of times before & it was completely remedied by the 2 offset setups above.
Best Answer
Paint first.
You don't have to worry about getting paint on the vanity.
Areas that would be hard with the vanity in place - in my bathroom, small wall sections on each end underneath the vanity since the countertop is wall-to-wall but the vanity is (deliberately) a little shorter - are very easy.
If you ever replace some or all of the vanity, countertop, etc. and the replacement is slightly smaller you won't end up with unfinished areas that then need to get painted.
But overall it is just simpler to paint large sections of walls than dealing with lots of edges.