Understanding how social behavior impacts investment into internal and external immune response