"תָּמִים תִּהְיֶה עִם ה' אֱלֹקיךָ"
"Complete [tamim] you will be with the Eternal your God" (Deut. 18:13)
The Midrash explains the verse as if the word תהי-ה ("you will be") was written twice. If "you will be complete" - then "you will be with God."
The Maggid explained this Midrash with the following parable:
A carpenter needed to glue together boards of wood. Sometimes the boards are smooth and straight, and sometimes he must glue together crooked boards.
When the boards are crooked, the carpenter must work hard. He must carefully examine both pieces of wood and determine the optimal way to attach the two boards together.
But when the boards are perfectly smooth and straight, the carpenter's work is easy. He does not need to carefully examine the boards from all angles. He simply spreads the glue on the wood, and presses the pieces together.
So too, the Torah tells us to "cleave to God." If a person is not straight, this 'cleaving' will be a difficult matter. One who wishes to cleave to God must correct his faults in order that he will be able to properly connect to God.
Therefore the Torah admonishes us to be tamim. We should make sure that our character traits are straight and our actions are honest. And then, as the Midrash explains, we can be "with God." We can easily cleave to God, like two straight boards .
(Adapted from Mishlei Yaakov, pp. 438-439)