I don't think this is a problem you think it is unless you can give an example of this error.
If I search for Mary Smith married to Joe Smith, Mary Smiths will appear.
If I search for Mary Smith married to Joe Jones, Mary Smiths will appear.
If I search for Mary Smith married to Joe Unknown, Mary Smiths will appear.
The husbands name does not matter as you are searching for a single person, Mary Smith. Not Mary Smith and Joe Smith as a whole. The only options on the Search Page are parents of the search subject. Everyone can be married multiple times and so Spouse's last name is not a search parameter.
Now, you may be confusing how the search engines works as you will also see for search matches for Mary Smith like Mary (Jones) Smith where the Current Last Name (Smith) is used to make the Match though though this Match's LNAB is Jones. This is correct as she is named as a Smith, though it is not this Match's LNAB. This is when the husband's or now Mary Jones' Current Last Name is used is used to make a Possible Match. And while this is a Possible Match, you know Mary Jones Smith is not your Mary Smith.
The WikiTree Search Engine actually tries to not exclude Possible Matches and sometimes seems to go out of its way to give us a bunch of extraneous matches all in the name of avoiding those dreaded duplicates.
Easy right? Now I will try to explain Quantum Mechanics in less than 5 sentences.....LOL
All kidding aside, if you have an example of a Profile where this error has occurred, please give it so it can be checked out.