The global outbreak of the COVID-19 pandemic is caused by severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2). Bat virus RaTG13 and SARS-CoV are also members of the coronavirus family and SARS-CoV caused a world-wide pandemic in 2003. SARS-CoV-2, SARS-CoV and RaTG13 bind to angiotensin-converting enzyme 2 (ACE2) through their receptor-binding domain (RBD) of the spike protein. SARS-CoV-2 binds ACE2 with a higher binding affinity than SARS-CoV and RaTG13. Here we performed molecular dynamics simulation of these binding complexes and calculated their binding free energies using a computational alanine scanning method. Our MD simulation and hotspot residue analysis showed that the lower binding affinity of SARS-CoV to ACE2 vs. SARS-CoV-2 to ACE2 can be explained by different hotspot interactions in these two systems. We also found that the lower binding affinity of RaTG13 to ACE2 is mainly due to a mutated residue (D501) which resulted in a less favorable complex formation for binding. We also calculated an important mutation of N501Y in SARS-CoV-2 using both alanine scanning calculation and a thermodynamic integration (TI) method. Both calculations confirmed a significant increase of the binding affinity of the N501Y mutant to ACE2 and explained its molecular mechanism. The present work provides an important theoretical basis for understanding the molecular mechanism in coronavirus spike protein binding to human ACE2.