We theoretically demonstrate that spin alignment in π-conjugated radical molecules can be controlled by photoexcitation and charge doping, accompanying transition from low-spin to high-spin states. To clarify the mechanism of such controllable spin alignment, we designed a model Hamiltonian, in which π electrons in fused carbon-ring systems are coupled, through exchange interactions, with two localized spins on stable radicals. The Hamiltonian is exactly solved in excited states as well as doped states, including all the correlation effects. In the lowest π-exited state of an anthracene-based molecular magnet, spin triplet in the π-electron system aligns the localized spins in parallel, giving rise to a high-spin state. Such meta-stable state would be reached through relaxation processes following photoexcitation. Furthermore, we study the doping-controlled spin-alignment in a thianthrene-based molecular magnet. Hole-doping induces ferromagnetic correlation between the localized spins, resulting in a high-spin state. Spin alignment around heteroatoms in thianthrene can be understood based on the superexchange mechanism. Our results are consistent with the recent experimental demonstration of spin-alignment control by photoexcitation and electronic doping, and provide useful insights into molecular design of controllable organic magnets.