"You get what you deserve nothing more nothing less"
Solution 1:
The first that comes to mind is
Birds of a feather flock together
This means that similar items (including people) are drawn to one another.
To say that "What you get is exactly what you deserve" you could use
You reap what you sow
Solution 2:
While not an idiom, there is a name in social psychology given to the phenomenon you've observed. It's the matching hypothesis:
It claims that people are more likely to form and succeed in a committed relationship with someone who is equally socially desirable.
Solution 3:
While I can't think of anything specific to relationships, there are a number of phrases that encompass the qualities of safety and caution.
- Find one's own level
- Play it safe
- Be on the safe side
- Make a safe bet
- Better to be safe than sorry
- Err on the side of caution
- It's best to take what one can
One might also consider a "potential candidate" out of one's league. One does not want to hit above one's weight either.
Solution 4:
"There's a lid for every pot"
Forgive this little editorial comment but I can also provide a very common expression that argues the contrary to your assumption:
"opposites attract"