XMPP is like email, a very open standard that was designed for interoperability even with more closed servers that included proprietary features and extensions. It can be configured to be secure and private. Matrix is another attempt at a more closed protocol / ecosystem with the difference that you can self host it. There have been also multiple complaints about the amounts of metadata that Matrix scatters across servers.
The only thing I dislike about XMPP is that stuff like push notifications and proper mobile clients aren't as easy to get as they are with Matrix. Privacy and protocol-wise I would pick it any day - even if the only advantage is that is is considerably simpler than Matrix.