Use so-called "white wood", i.e. spruce or pine without pronounced knots if possible. Stay away from southern yellow pine; it warps like nobody's business.
Sight along the edge and find one relatively straight, i.e. not "rainbowed" or "crowned". A little bend or deflection right or left is no problem, as you can easily draw that to the wall. Stay away from anything with an obvious twist, although that too can be drawn down flat.
BTW, unless your wall was done with metal studs, it's not perfectly flat either. It's only approximately flat, as good frame carpenters always orient studs "crown up" on one side when framing a wall. If they didn't, you'd see it alright.
Here's the thing: "cupping". Of course you want the flattest possible board across the width, as cupping is hard to draw down. With your mount, I'd put the cup out, facing away from the wall, so the mount can span the cup without being warped, as it would be with cup down (humped out). Ever see what happens when a plywood scrap is thrown onto damp ground? It cups *up* as moisture is absorbed on the bottom and the grain expands.
So mount your 2x12 cup *up* or out and paint the outer face. Draw down your lags tighter within half an hour or so and you can perhaps flatten it out slightly. The closer your lags are to the edge, the better this will work, but you must not get so close to the edge that you weaken the attachment or split the board. And they must not interfere with the placement of the mounting plate lags.
The above assumes you can't get anything perfectly flat, but you should be able to pick one close enough so it doesn't matter.