Praise be to Allah.
First of all, we share your astonishment at the answer of this imam whose was not wise and was not appropriate to the case that was presented to him. Yes, a person could advise one who wants to get married in ordinary circumstances to marry someone from the same country or region as himself, so as to avoid differences in customs, traditions and so on, which can cause a lot of family problems, let alone the possible consequences of staying away from one’s country, such as severing of family ties and the like.
But with regard to your problem, the matter is different in all aspects. Hence the advice of this imam was not appropriate. Moreover, giving advice is one thing and explaining the Islamic ruling to one who is asking about it is something else. If the imam was being asked for Islamic advice, he should have explained the ruling of Islam on the matter being referred to him, then after that he could give his advice in the light of what he thinks is in the best interests of the questioner.
If you did your marriage contract with this Muslim girl, with the proposal and acceptance as prescribed in sharee‘ah, and all the pillars or essential requirements of marriage were fulfilled, and the marriage contract was done by the imam of the neighbourhood in which you live or by the director of the Islamic Centre in your locality, then your marriage to this girl is valid. But in fact you did not need to travel with her without a mahram; this is something that was not permissible for you. And you should not have married her far away from her family, because they were not opposed to your marrying her and they were not opposed to her in her choice of religion. You could have brought her family to where you live or brought some of them, and the marriage could have been done in the proper Islamic fashion and in an appropriate social environment, so that her family could have attended and it would not have appeared to exclude them or go against their wishes.
But whatever the case, so long as the matter is done and there have not been any problems with your wife’s family, then the marriage is valid even though there was the issue of your travelling with her without a mahram, which against the teachings of Islam. May Allah forgive you and her.
And Allah knows best.