Partnership income

Why would Sec. 1231 gain be excluded from ordinary income, but Sec. 1250 gain included?