How important are CS courses for a pure mathematics PhD admission? I am a junior majoring in math and I am thinking about doing PhD in pure math, but my transcript got low grades (two Cs) from the two CS courses in hardware systems and programming languages. 

How much will these two courses affect my application chances? My general GPA at this point is 3.5, while my math GPA is 3.8. Also, I have research experience with letters of recommendation from my professors.
Other than lowering your GPA, I don't think these two grades will matter much in a pure math PhD application.  After all, many pure math applicants take no CS courses at all, so it is certainly not the case that admissions committees are systematically screening for CS skill.  Moreover, not everyone in pure math values programming ability, skill or experience (not as much as we should, probably) and those who do are probably math-centric enough to believe that an applicant who is mathematically strong could become a good programmer if they put their mind to it.  

Anyway, what's done is done.  I wouldn't worry much about it, and in particular I would not feel the need to try to spin / justify these grades in your personal statement.