And it was NOT Jesus who said that it was not good to marry. He would have been contradicting Himself had He said that.
That was what the disciples said when they discovered that divorce was strictly limited (rather than the way it was being abused by the Pharisees and others).
he did say it was what the disciples thought -
Then in Matthew 19:11 the disciples seem to believe that Jesus is teaching them: "It is better not to marry".
it was what they took the implication of Jesus' words to them to be. doesn't mean they were right. Jesus replied that for the one who could accept remaining unmarried, it is good for them to receive it, but that it isn't so for everyone ((vv. 11-12)).