Bampumim Teixeira was arrested after police exchanged fire with him while responding to reports of an intruder at the high-rise flats on Friday night.
The bodies of anaesthetists Richard Field and Lina Bolanos, engaged to be married, were found inside.
The suspect was in hospital with non-life threatening injuries.
Police said a suspect fired at officers who were responding to a report of a man with a gun at a luxury high-rise in South Boston.
Upon arrival, officers found a set of keys on the floor and used them to open the door when no one responded to their shouts, Suffolk Assistant District Attorney John Pappas said during Mr Teixeira's arraignment on Monday.
Mr Teixeira was struck in the hand, abdomen and leg during an exchange of gunfire with the two officers.
The officers apprehended Mr Teixeira inside the penthouse flat before discovering Dr Field, 49, and Dr Bolanos, 36, who were already dead, the Boston Globe reported.
A message of retribution was apparently written on the wall, an official told the newspaper. Their hands were tied and throats cut, the paper said.
Mr Pappas declined to say the cause of death, but said both victims had suffered "obvious trauma" and were pronounced dead at the scene.
Dr Field - who is from London, according to his Facebook page - sent two text messages to a friend in a plea for help, Mr Pappas said.
The friend called the police, Mr Pappas added.
Police also discovered a black backpack at the scene containing jewellery, which authorities believe belonged to Ms Bolanos.
A motive for the attack is still unclear and Mr Pappas did not say how Mr Teixeira was able to get through tight security to reach the top levels of the residential complex.
Mr Teixeira was recently released from prison after serving nine months for bank robbery.
He was charged on Monday from his hospital bed at Tufts Medical Center in Boston and was held without bail on two counts of murder.
Mr Teixeira's lawyer entered not-guilty pleas for him. His next hearing is set for 8 June.
Dr Bolanos was a paediatric anaesthesiologist at Massachusetts Eye and Ear Infirmary while Dr Field worked at the Brigham and Women's Hospital, an affiliate of Harvard Medical School.
Dr Bolanos had cancelled plans on Friday night to invite her boss for dinner because Dr Field was not feeling well, the Boston Globe reports.
In a bizarre twist, the intended dinner guest - Dr Sunil Eappen - happens to have been the father of a toddler who was shaken to death by a British nanny two decades ago.
Louise Woodward, was convicted of the involuntary manslaughter of eight-month-old Matthew Eappen in Boston in 1997.