It's Matts problem, not yours. You're not flirting, you're just being friendly like you were before they got married, nothings changed. You're good friends with both of them.

If I were you I'd go and talk to him, make him understand there's nothing going on, its just jokes, like it was in high school.
If he fails to see this, tell him it's his problem.