Not to mention that when Ned came back from the Tower of Joy, he didn't even know her that well. By the time of AGoT could he have trusted her with that secret? Absolutely. But when Jon was born, there was no way of knowing she could be trusted and then how do you break it to her years later, "BTW I've been lying to you for 14 years."
It also keeps Cat safe if she genuinely doesn't know. Not bringing her in on it, which would be considered treason in Robert's eyes, would keep her safe if the truth ever was discovered. Just her knowing could endanger the whole situation as, though she may have tried to feign it, it would be hard to be as genuinely cold to Jon as she was before knowing the truth. If she changed how she acted, even in subtle ways, that could start to unravel the whole thing.
So yeah, it was shitty to lie to Cat (and to Jon himself, of course), but even if Lyanna didn't specifically tell him to (which she may well might have), it was absolutely the right choice to never speak this truth aloud.