When a doctor has suggested u to remove thos teeths means those are destroyed way beyond saving, usually a deep cavity in a tooth can be sorted out with root canal treatment,may be u don't have sufficient tooth structure left to do root canal treatment,if so,then better get it removed and go for replacement procedures.
Next Steps
consult ur doctor as see wether any way to save thos teeths rather than Removing them,