These are diplomatic forays. When you train foreign doctors, they tend to have a very positive view of Bangladesh. It is hoped that they will also help promote Bangladeshi Pharma products in their home country to some extent. But you're right, it is largely charity.
In the sixties and seventies, the US used to provide free scholarships and room/board for medical students from 3rd world countries. Nowadays, no more, thanks to policy change. For being a wealthy country, the US is the least generous of most large economies. Japan in this arena is the most generous, as are some of the Scandinavian countries.
However the US govt. did establish the Int'l Center of Diarrhoeal Research (ICDDRB) in Dhaka back in the sixties. That place has made Bangladesh one of the most important places for Gastro-intestinal research in the world.
It has also saved millions of local lives in the process, we used to have a scourge of diarrhoea...nowadays the focus is more on other pandemic diseases such as dengue, ebola, west nile etc...