Why did Jesus keep telling people not to tell anyone that he healed them? He knew that by sharing that news many people would get to know him, so why not let them do it? Even when he told them to be silent the news of his power spread everywhere, didn’t it?
Jesus had a very keen sense of timing. According to prophecy, he had to die in Jerusalem, at the Passover in a particular year. If he had been identified as the Messiah publicly or of he had been identified as the Son of God or as God publicly, his ministry would have come to a head and he would have been killed at the wrong time. There are many passages which show Jesus’ sense of timing and caution to not come out too early. In John 2:4 he told his mother that the time to begin his ministry had not yet come. In John 7:6 when his brothers challenge him to go to the festival openly, he tells them that “the right time for me has not yet come. Luke 9:51 we see the comment that the time was approaching for him to be taken to heaven. At that time, he turned his face resolutely toward Jerusalem.
It is true that when Jesus told some people not to tell people what he had done, they did not necessarily take that advice. This is further evidence that he had to be cautious about the timing. There were people who were going to want to make him king, and that is not what God had in mind. In fact, in John 6:15 we are told that the people wanted to come and make him king by force. If Jesus had not been cautious, then the few who spread the news anyway would have become a flood which even he could not have controlled.
It has everything to do with timing.
I hope this helps.