Currently removing modules from an entity requires you to either have a module of the same sort in your inventory, or to remove and replace the entity.
It would be nice if we could have a shortcut button to do the same thing.
EDIT: Just found that you can remove modules with any quality module. I'd only tried hotswapping, not removing and then adding.