The article makes no reference to their cohabitating and I won't guess on that.
I personally think cohabitation without the benefit of marriage should be grounds for dismissal from any Catholic institution in and of itself.
I'm with you on that (and I'd add "from any Protestant institution, also" to your statement). From the way the article is written (and this may be the fault of the writer, not the Church), the teacher was let go for fathering an illegitimate child, and not for willful sexual immorality in and of itself. That's just not right.