Not a bug, it's just something they can do, not something they'll unconditionally do all the time whenever they have the opportunity, in the same way that they don't always hack other bots. Their general priority is still to attack enemies (and there are other conditions, too, like they have to be close to the Terminal itself, among other requirements).
It's working as intended.