EE & ER HSA Contribution via payroll and outside payroll for CA state tax

My employer contributed $X towards HSA (reported in W-2) and I contributed $Y (outside paycheck) in 2017 towards 2016 tax year. $X+$Y = Allowed Limit & $X > $Y. For California tax return, TT does addition of $X and subtraction of $Y to taxable income, instead of addition of $X & $Y. Why?