Heat oil in a large skillet or wok over medium-high heat. Add onions, garlic, and scallions (white parts only). Stir fry until fragrant and lightly golden.
Crumble the tofu directly into the pan, breaking it into small, bite-sized pieces. Cook for 5–6 minutes, stirring occasionally, until slightly golden and beginning to crisp around the edges.
In a small bowl, whisk together soy sauce, vinegar, sesame oil, and ginger. Pour over the tofu mixture and toss to coat evenly. Allow it to cook for another 2–3 minutes so the tofu absorbs the sauce.
Stir in fresh spinach and cook until just wilted, about 1–2 minutes. Adjust seasoning with black pepper and chili flakes.
Top with scallion greens and sesame seeds. Serve hot with steamed rice, noodles, or even in lettuce wraps.