Soft x-ray absorption experiments on the transition metal L2,3 edge of multiferroic MnWO4 and antiferromagnetic CoWO4 are presented. The observed linear polarization dependence, analyzed by full-multiplet calculations, is used to determine the ground state wave function of the magnetic Mn2+ and Co2+ ions. The impact of the local structure and the spin-orbit coupling on the orbital moment is discussed in terms of the single-ion anisotropy. It is shown that the orbital moment in CoWO4 is responsible for the collinear antiferromagnetism, while the small size of spin-orbit coupling effects make spiral magnetic order in MnWO4 possible, enabling the material to be multiferroic.