1. Bring vinegar and sugar to a simmer in a small saucepan over moderately high heat, stirring until sugar is dissolved, about 2 minutes. Add red onion and cook, stirring, 2 minutes. Pour mixture into a heatproof bowl and let cool. Keep chilled and covered.
2. Heat oil in an 11-inch nonstick skillet over moderate heat until hot but not smoking. Add potatoes and yellow onion and cook, flipping them occasionally with a spatula and keeping them evenly distributed over bottom of pan, until just tender, about 7 minutes.
3. Preheat broiler. While vegetables are cooking, whisk together eggs, spinach, salt, pepper, and nutmeg.
4. Pour egg mixture evenly over vegetables in skillet, being careful not to disturb them, and cook over moderate heat without stirring, until bottom is set and golden brown, about 4 minutes. Place skillet under broiler 5 to 6 inches from heat and cook until top of egg is set, 2 to 3 minutes.
5. Gently shake skillet from side to side and run a spatula around edge of tortilla. Slide tortilla onto a cutting board and let cool to room temperature. Cut tortilla into bite-size pieces and serve topped with pickled onions.