The capital gains tax raises money for government but penalizes investment (by reducing the final rate of return).
Congress sometimes directs the Congressional Budget Office (CBO) to estimate the effects of a bill to change the tax code.