Why does encrypting the Diffie-Hellman value with the other side’s public key prevent man-in-the middle? As far as I understood about Diffie-Hellman, it is easy for the man in the middle to easily decrypt and read the message.
It's because, Eve (attacker) can't break the encrypted data since Eve doesn't have other side's private key. Only by using other side's private key, the encrypted data can be decrypted. 

And yes, this is general technique for preventing Man-In-the-Middle attack using asymmetric keys. Diffie-Hellman is Symmetric Key Exchange Protocol, not encryption mechanism. 

First two numbers are generated g and p where p is prime.

One side:

$R_1 = g^x \bmod p$ where $x$ is randomly chosen

Send $R_1$ to other side, Receive $R_2$

Calculate key as $K = {R_2}^x \bmod p$

Other side:

$R_2 = g^y \bmod p$ where $y$ is randomly chosen

Send $R_2$ to other side, Receive $R_1$

Calculate key as $K = {R_1}^y \bmod p$

Also, Diffie-Hellman doesn't prevent Man-In-The-Middle; it's one of Diffie-Hellman's weakness and it's vulnerable to it.