Personally, I think it's easier to understand the deuterostomes: the "mouth" will benefit from being controlled by input from sensory organs, and those need to be on the outside of the body. Thus, a natural bending of a flattish body-shape into a horseshoe, with the mouth on the outside of the "bend."
Also, a fun fact to go with yours: vertebrates are triploblasts. That means, when we first fold over (gastrulize), our cells differentiate into three types--one on the "inner wall" of the fold, one on the inside of the body, and one on the exposed "outer wall" of the fold. In other words: we're all tacos!
Another, perhaps more-weird-than-fun fact: our DNA is basically three separate "code bases", one for each layer. It is much easier for a given feature to evolve by differentiating from similar tissue proteins in its own layer, than in another layer. (In fact, to do otherwise, the resulting proteins still have to "start off" in their ancestral layer, before "migrating" during development.)
Anyway: our brains--which you'd think of as an "internal" organ--are actually part of the ectoderm, and in lower organisms, the first thing that the ectoderm is, is skin. So, your brain (and your nerves, your spine, and most of your sensory organs) are all effectively "kinds of" skin tissue. Your nerves? Skin with capacitance. Your spine and teeth? Calcified nerves. The reward centre of your brain? Modified skin pigmentation cells. Your retina: also skin pigmentation cells. Your iris: modified retinal cells.
Basically, evolution always starts its feature branches with a bit of copy-and-paste programming. :)