If I were in that situation, I would absolutely have to let him know.
Not too long ago, I met a woman and we've become good friends. She didn't know I was trans and she didn't cop on. But I eventually told her. Things were getting awkward. We were becoming close and she was beginning to ask questions about my marriage, etc. It would have been very hard to keep the truth from her, and if I'd wanted to, I'd have had to come up with some big story to cover up a lot of things. And then I'd always have to remember what I'd told her and what I hadn't told her. I think I'd have become a nervous wreck. So much easier just to tell her, and if she didn't like it, she wasn't a friend anyway. As it turned out, she had no problem with it, and so there's no pressure on me.
I can't imagine how anyone could actually marry someone and not tell them something like this. No telling how many lies you'd have to tell--either by omission or commission. I can't see that being a happy situation.
Besides which, I think a spouse is entitled to know. Maybe it's not fair. But when you're trans, lots of things are hard where other people have them easier. Just the way it is. I can't imagine trying to hide something like this from a spouse.