There are usually no significant ethical issues with Cognitive studies into memory. However, this study involved patients who could not give valid consent, because they would not be able to remember having the study explained to them. This means the researchers could only obtain presumptive consent from the patients' doctors and carers. HM was studied all his adult life and could never consent to any of it, making him a human guinea pig. Increasingly, ethicists regard it as unacceptable to treat the lack of refusal as tacit consent.
However, the benefits to our scientific understanding of brain functioning from studying patients like H.M. have been so enormous, it may outweigh the lack of consent from these few, unusual patients. This would be a case of a cost-benefit calculation, with one principle of ethics (social responsibility for the common good) counting agaist another (failure to respect dignity and autonomy).