Best way to repair the crawl space vent
What would be the best way to repair this hole?

The best fix applies to both of these vents, they should be replaced.

How did they mount this wire mesh to the stucco?

It's likely stapled to the back of the stucco face, and there may be thin wood applied behind the mesh to help reinforce it and make it look embedded and not just tacked-on.

My best guess is that they stapled it before the applied the 3 coats of stucco and it is semi embedded.

Exactly.

Is it recommended to paint over the mesh? Why was this done?

Either the stucco or paint was probably applied by sprayer. It's extremely time-consuming to evenly paint a house exterior, and sprayers are much faster.
For your fix, replace the mesh the same way it was originally installed (you can check from inside the crawlspace, you'll have to get in there anyway to staple your new mesh) and then paint over it if you want it to match, or just the stucco frame around the new mesh.