Honestly what is the point of Star reaching the "Realm of Magic" if she's going to come back(back to Mewni) right after Marco called her.Why does the place keep her "hypnotised" into staying there?What is her purpose of going to that dimension?
What was the purpose of her going there, and why she wanted to be called there (if we are to trust the words of the magic horse), I don’t know. Was it a way for her to completely master the Butterfly form, or would she have managed to do that anyway? Was it the same the place Glossaryck and Star were in Toffee? Maybe Glossaryck’s essence and “mind” is still there?
About the meaning of her being back after having answered to Marco’s call, that might be a bit easier to speculate about: the trope of snapping out of a trance state induced by a “fake paradise” is quite common in fiction, and usually wants to emphasize how important the person calling is to the one who refuses a life of pleasure and lack of duties (another important theme in the show!) if that means losing their loved ones (a similar theme, this time brought to its extreme, as Star Vs Echo Creek’s one). Marco went through something similar, with Star being his anchor to real life, in Running With Scissors - an episode that was heavily referenced, in a way, just the segment before Deep Dive. This post talks about the parallels in a way more articulate way.
Also it gave Marco a good reason to use magic.