That sucks no matter what the reason for the extractions was, but I have to ask: was that in any way related to your other medical issues? I doubt it, but you mentioned it and my tired mind starts to wonder.
Infection inside the heart, known as infective endocarditis, is a serious and potential life threatening risk of any heart surgery. It is also often caused by bacteria which live in our oral cavities and on our teeth. A full dental clearance removes much of the surface on which these bacteria live (such as on plaque between teeth), makes it easier to keep the entire of the mouth clean, and also prevents the requirement for any dental procedures after the heart surgery which can force such bacteria in to the blood stream and towards the heart.
It sounds extreme, but is actually pretty commonplace before such an operation, and is certainly worth it for reducing the risk of infective endocarditis.