Why did Jesus order the unclean spirits in the Multitude at the Seaside (Mark 3.7-12) to not make him known? The passage I am referring to is Mark 3.11-12:


  11 Whenever the unclean spirits saw him, they fell down before him and shouted, “You are the Son of God!” 12 But he sternly ordered them not to make him known.


I'm confused because why would Jesus not want the multitude of people present with him to not know he is the Son of God? Isn't that what Jesus wanted?
Reason 1: The test of whether a message is Jesus' message.
The Apostle John gave us this test:

Dear friends, do not believe every spirit, but test the spirits to see
whether they are from God, because many false prophets have gone out
into the world. 2 This is how you can recognize the Spirit of God:
Every spirit that acknowledges that Jesus Christ has come in the flesh
is from God, 3 but every spirit that does not acknowledge Jesus is not
from God. This is the spirit of the antichrist, which you have heard
is coming and even now is already in the world. (1 John 4:1-3)

God has sovereignly prevented demons from declaring this truth, as your reference to Mark 3 affirms. If He did not do so, the Apostle's test would fail, because demons could counterfeit messages from God by saying Jesus was God come in the flesh. It is a matter of a divine authentication protocol. (I am a software engineer.)
Indeed, many of the teachings labeled by the early church to be heresies were ones that denied that, or denied part of it.

Jesus seemed to come in the flesh, but it was an illusion; he was just a spirit.

Jesus came in the flesh, but only had a divine will, not a human will, too.

Jesus was human and special, but was created, not the eternal God.
And so on and so forth. The evil spirits keep trying to find new ways to almost affirm this truth and so deceive believers while packing it along with lies.


Reason 2: The Source of Jesus' power.
The Pharisees accused Jesus of working for Satan. Jesus had to make sure that there was a bright line that separated him and his message from that of the enemy.

22 Then they brought him a demon-possessed man who was blind and mute,
and Jesus healed him, so that he could both talk and see. 23 All the
people were astonished and said, “Could this be the Son of David?”
24 But when the Pharisees heard this, they said, “It is only by
Beelzebul, the prince of demons, that this fellow drives out demons.”
25 Jesus knew their thoughts and said to them, “Every kingdom divided
against itself will be ruined, and every city or household divided
against itself will not stand. 26 If Satan drives out Satan, he is
divided against himself. How then can his kingdom stand? 27 And if I
drive out demons by Beelzebul, by whom do your people drive them out?
So then, they will be your judges. 28 But if it is by the Spirit of
God that I drive out demons, then the kingdom of God has come upon
you. (Matthew 12:22-28)

Jesus was not like the Sorceress Supreme in Doctor Strange, who tried to do good, yet by drawing her power from the Dark Dimension of Dormammu, imperiled the world. He had to make that clear. The demons seek to trick people by seeming to help Jesus, thereby tarnishing his message and reputation.