Why would you check the diaphragm during echocardiogram?

Respiratory function. This would allow the person reading the echocardiogram to determine if any respiratory difficulties might be due to diaphragmatic dysfunction.
Right under heart. You don't examine the diaphragm muscle during an echo study, but rather you routinely obtain certain images of the heart from a position of holding the imaging probe just under the diaphragm and "looking" up. The heart sits immediately on top of the diaphragm, so this view allows imaging of certain structures not seen well in other views.