Answer :

Each enzyme cuts a specific sequence with specific ends(that will attach to other DNA). If the two pieces of DNA are cut with different enzymes then their ends will not match up and they will not join properly.
underV
The reason why is necessary to use the same restriction enzyme is because
if we don't, the two pieces of DNA that we are trying to joint won't have matching ends and won't join properly.


To insert that gene we first cut him out from a DNA sequence(sequence 1), so To do that we use a restriction enzyme.

Meanwhile, we want to put that piece into another DNA sequence (sequence 2), so we also have to make a cut to be able to insert the gene and that will also be done with the same restriction enzyme.

This restriction enzyme needs to be the same one that cut the gene out of sequence 1. The enzyme recognizes specific sites in DNA, so when joined they will have ends that will match the gene's ends.