In this work, we study the relation of the cosmic environment and morphology with the star formation and stellar population of galaxies. Most importantly, we examine if this relation differs for systems with active and non-active supermassive black holes. For that purpose, we used 551 X-ray detected active galactic nuclei (AGNs) and 16 917 non-AGN galaxies in the COSMOS-Legacy survey for which surface-density field measurements are available. The sources lie at a redshift of 0.3 < z < 1.2, probe X-ray luminosities of 42 < log[LX,2−10 keV(erg s−1)] < 44, and have stellar masses of 10.5 < log [M*(M⊙)] < 11.5. Our results show that isolated AGNs (field) have lower star formation rates (SFRs) compared to non-AGNs at all LX spanned by our sample. However, in denser environments (filaments and clusters), moderate LX AGN (log[LX,2−10 keV(erg s−1)] > 43) and non-AGN galaxies have similar SFRs. We also examined the stellar populations and the morphology of the sources in different cosmic fields. For the same morphological type, we find that non-AGN galaxies tend to have older stellar populations and are less likely to have undergone a recent burst in denser environments compared to their field counterparts. The differences in the stellar populations concerning density field are mainly driven by quiescent systems. Moreover, low LX AGNs present negligible variations of their stellar populations in all cosmic environments, whereas moderate LX AGNs have, on average, younger stellar populations and are more likely to have undergone a recent burst in high-density fields. Finally, in the case of non-AGN galaxies, the fraction of bulge-dominated (BD) systems increases with the density field, while BD AGNs are scarce in denser environments. Our results are consistent with a scenario in which a common mechanism, such as mergers, triggers both the star-formation and the AGN activity.