Magnetism of covalently functionalized carbon nanotubes