The current answers don't address the question in detail. So here goes:
What is the source and reason for this?
The source is the Mishna in Yevamos 64a and the subsequent discussion in the Talmud there. The reason is that the man is commanded to have children, and after 10 years with no pregnancy, he needs to do something else to fulfill the Mitzvah. It follows from that if we know the issue is with the man, there is no such obligation at all. (The Talmud there raises this possibility, and it is further discussed in the sources further on).
Is it an obligation or just recommended as a praiseworthy thing?
The Rambam (Ishus 15:28) says it is obligatory and non-negotiable (i.e. he is forced, just as he is forced to marry), and S.A. E.H. 154:10 paskens this way. The Rama, however (E.H. 1:3 and 154:10) says that in most issues of marriage issues we no longer force anybody to do these things (insist they get married, insist they divorce, etc.).
The Pischei Teshuva 154 s.v. 27 brings opinions that one is not personally obligated to divorce either and brings a lengthy discussion as to why. The upshot is that there are several opinions that this law only applies to someone living in Israel, and even according to the other opinions, there are limits to how much one has to lose in order to fulfill a positive commandment, and losing a wife of 10 years can be a tremendous loss. Note the context he is talking about is divorce where marrying a second additional wife is not possible due to the Cherem of Rabbeinu Gershom.
Does it matter if the husband already fulfilled the mitzvah of being fruitful and multiplying?
Yes it does. If he already has fulfilled the Mitzvah, this whole discussion doesn't apply.