Joseph was a righteous man. Matthew 1:18
That’s what it says right there. “Her husband (it says in the previous line) being righteous AND not willing to expose her publicly.”
OK, let’s start off with the apologies. First to Professor Jerry Hawthorne, who taught me koine Greek in college so I wouldn’t have to rely on an interlinear crutch. I’m sorry, Jerry. The fact is, I haven’t “kept up with my Greek,” as the phrase goes, and I need a crutch. This is from http://www.biblehub.com and I recommend it highly for all the reasons you can see right there on the page. 
Here’s how it works. The top line is a numbering system devised by James Strong in the late 19th Century. It identifies other places in the Bible where this Greek word—díkaios, in this case—appears. The second line transliterates the Greek text (line 3) into our alphabet. The fourth line translates it and the fifth line “parses” it, i.e. it gives the grammatical location of the word. We see here that díkaios is an adjective and that it is a nominative, masculine, singular (NMS) adjective, which fits Joseph perfectly.
What does “and” mean?
This text is what is “there,” so to speak. I am interested today in what it means. Particularly, I am interested in what “and” means. What is the relationship between Joseph’s righteousness and his mercy—his choosing the quietest, least painful way available to treat Mary’s “infidelity.” 
The people who made this little poster have no interest in “and” at all. They note that the one thing is true and also that the other thing is true. Way too little curiosity, I say.
There are two schools of thought on this among scholars of the Birth Narratives.  The first is that “and” means “therefore.” Joseph was a righteous man and therefore he wanted to do everything he could to show mercy to this sinful woman. Short of consummating the marriage, of course. The mercy proceeds from the righteousness. Righteousness, in this reading, is the kind of trait that produces merciful behavior.
The second is that “and” means something more like “but,” or “even though.” Joseph showed mercy to Mary “even though” he was a righteous man. Righteous in this sense means “knowing and observing the Law of Moses.” We know what the Law of Moses says could be done—the actual practices may have varied by region and certainly varied by historical period—to Mary because of her obvious infidelity. She was, in fact, pregnant, and Joseph was not the father, so we find ourselves in “the usual suspects” territory.
The text will bear either interpretation of the relationship between Joseph’s righteousness and his personal inclinations, which is why, of course, different scholars understand the same text differently. And when texts are interpreted in several ways, it is very hard not to choose the one we like best, rather than the one that is most likely. It is very hard; trust me on that. A few highly disciplined scholars might do that  but the church will not and individual disciples, as a rule, will not either.
An Intermediate Course
There is an intermediate course, fortunately. It is not an alternative meaning; it is an alternative way of choosing a meaning. About that course, there is good news and bad news. The good news is that it gives us an additional key for interpreting what Matthew might have had in mind. The bad news is that to use this key, we will have to go further from the text and root around a little bit in just why Matthew might have cast this story as he did.
Here’s an idea. It is Raymond Brown’s idea again. I hate to keep emphasizing that, but he is a scholar and I am not and he is the scholar of the infancy narratives I know best and trust most. It starts with Matthew’s desire to affirm both the Law and the Revelation in Jesus Christ. Matthew is clearly the most “both/and” of the evangelists. Take Matthew 13:52, for instance, in which some scholars believe Matthew is referring to himself.
And in the spirit of both/and, Matthew has nothing to lose by bearing down hard on the righteousness (dikaiosúnë) of Joseph, meaning a careful, even a rigid, adherence to the Law of Moses. Matthew can bang that drum as hard as he pleases because the next event is that Joseph receives a revelation in a dream.
In 1:20, an angel appears to Joseph—Joseph the father of Jesus has a lot of similarities to Joseph the Patriarch as dreams go—and tells him not to be afraid to bring Mary to his home because her pregnancy has nothing at all to do with infidelity. And Joseph receives this new word and gives it primacy over the old word, the Law of Moses, and does gladly what the Law of Moses would forbid.
This relationship between the “old Word,” the word God gave to Israel, and the “new Word,” the word that Jesus embodies and proclaims, will be the theme of Matthew’s gospel generally. So it makes great sense for him to tuck it into the earliest part of his gospel, the birth narrative of Jesus.
Making a choice
That is an elegant solution to the textual problem, I think, but it brings us right to the lip of the problem I posed earlier. What are we going to do? How are we going to understand the relationship of righteousness and mercy in the story Matthew tells us. In the churches I know best, there is not much appetite for righteousness, meaning the careful observation of God’s requirements. The only thing we are really judgmental about is the fact that some churches emphasize God’s judgment, where we think the mercy of God should be favored. Judgmentalism just makes us angry.
On the other hand, we really don’t think that we should choose the interpretation we like best. We think we should favor the “best interpretation,” whatever the scholars determine that to be. That is what is behind the cherrypicking we do—not of texts, but of scholars; we just want the meaning we like best to be the best scholarly judgment. It’s sad, really, but there it is.
So it isn’t easy. But then, it wasn’t easy for Joseph either. The dilemma he faced about Mary was not easy and the message of the angel, which replaced one dilemma with another, also wasn’t easy. So it is perfectly appropriate that we begin this Advent, one based on Matthew’s account, by celebrating the courage of the legal husband of Mary and the legal father of Jesus.
 The site has a lot more than an interlinear text, so the way I get to this site is to google “interlinear new testament” and choose the http://www.biblehub.com site from the list.
 It is a shame, really, that the meaning of the word “infidelity” has shrunk so much that it now means “having sex with someone other than your spouse.” With that shrunken meaning, we can hardly see that Joseph is being asked to be faithful to God’s plan and would be committing an act of infidelity had he refused. As it happens, both Mary and Joseph are faithful.
 My principal source for all this is Raymond E. Brown’s The Birth of the Messiah, the best and most thorough book I know about the birth narrative. In the Revised Edition, which I am using, having worn out my first one, this discussion appears on pp. 126—128.
 And very likely would be punished by vigilant peers if they did not.