Chromium triiodide (CrI$_3$) monolayers have attracted much attention in both electronics and spintronics due to their potential applications among the first two-dimensional (2D) materials discovered experimentally. By means of density functional theory, we perform investigations of the electronic structures and magnetic properties of CrI$_3$ monolayer doped with 3d transition-metal (TM) atoms, which is also called CrXI$_6$ monolayer with X changed from Sc to Fe. It is shown that the electron properties of the CrXI$_6$ system can be tuned from semiconductor to metal/half-metal, which depend on the types of TM atoms. In addition, the CrXI$_6$ system improves ferromagnetic stabilities, enhancement of magnetic moments, and ferromagnetic-to-antiferromagnetic transition. This findings enrich the potential application perspectives of CrI$_3$ monolayer in spintronics.