This retort was found in a joke book that was published before Boswell was born, but Boswell was "so desperate for material that he was too accepting of material he was provided." Boswell was not present when Johnson is supposed to have said this, he is reporting something he was told by someone who passed it along as something Johnson said. As for receivers of stolen goods, prior to the establishment of regular municipal police forces private individuals were hired on a piecework basis to combat rising crime in London in the 18th century, but they began to operate on both sides of the law when they realized the opportunities for profit that their position gave them; they would often steal goods themselves, returning them for bounties. Two notorious men in this line of work were Charles Hitchen (sometimes spelled "Hitchin") and Jonathan Wild (sometimes spelled "Wilde"). As Henry Fielding put it, "if there were no Receivers (of stolen goods), there would be no Thieves." Wild was eventually sentenced to death, took a large dose of laudanum (alcohol + opium) and fell into a coma; he was hanged while still drugged.
As to the joke itself, I think it comes down to this: The man's wife (or mother in another telling) is said to be accused of operating a whorehouse, but is in fact something worse--a receiver of stolen goods, which was punishable by death, while operating a bawdy house--while disreputable--was not a capital crime. It's a bit like the old joke "Who was that lady I saw you with last night?" "That was no lady, that was my wife." In seeming to excuse the woman, the speaker actually accuses her of something worse.
Jorge Luis Borges says in "The Art of Verbal Abuse" that Johnson (or the original joke teller) was engaging in a "parody of insult" in saying this.