Hamilton has published more than 130 papers, proceedings, and reports, about sixty projects, and six major programs. She is one of the people credited with coining the term "software engineering". On November 22, 2016, Hamilton received the Presidential Medal of Freedom from president Barack Obama for her work leading to the development of on-board flight software for NASA's Apollo Moon missions.
Without the scientist's meticulous work, the lunar landing might have ended in a dead end. Minutes before the lander's touchdown, in fact, several alarms went off due to the unexpected (and unnecessary, at the time) activation of the LEM's re-entry radar on the command module. The software developed by Hamilton was able to overlook that error, which risked overloading the onboard computer, compromising the landing, to focus only on the descent and the lunar landing information to be given to the astronauts. Margaret had foreseen the possibility of information overload and conflict during descent, and had developed a program capable of organizing tasks according to priorities, excluding unnecessary ones.