hi,
there may be a lot of reasons, most of them no due to modx... beginning with your hoster own security !
i’ve already been hacked a few times on some websites i was running and, getting in touch with the hackers (it’s often a good idea when they leave a contact even if a bit freaking i admint

)once, they explained me they had used a security fail of the server kernel
another time, they explained me that the hoster root database passwords were not encrypted
something else that is quite useful for you to understand the causes is to get in touch with your hoster and, if they are honest (a lot of them are) ask them if you’re the only one in that case. If not, you could guess the problem isn’t modx
cheer up...
have swing