The ground state of the simple Heisenberg nearest-neighbor quantum kagome antiferromagnetic model is a magnetically disordered spin liquid, yet various perturbations may lead to fundamentally different states. Here we disclose the origin of magnetic ordering in the structurally-perfect kagome material YCu$_3$(OH)$_6$Cl$_3$, which is free of the widespread impurity problem. {it Ab-initio} calculations and modeling of its magnetic susceptibility reveal that, similar to the archetypal case of herbertsmithite, the nearest-neighbor exchange is by far the dominant isotropic interaction. Dzyaloshinskii-Moriya (DM) magnetic anisotropy deduced from electron spin resonance and specific-heat measurements is, however, significantly larger than in herbertsmithite. By enhancing spin correlations within kagome planes, this anisotropy is essential for magnetic ordering. Our study isolates the effect of DM anisotropy from other perturbations and unambiguously confirms the theoretical phase diagram.