Just to add an important element to the other answers...
Given Walter's high intelligence and the obvious benefits of working at a successful pharmaceutical company, why didn't he make this seemingly more logical decision?
Walt's motivation wasn't to pay for his cancer - in fact he initially refused to get treated in the first place (see the pillow scene from Season 1). His actual motivation was to leave money for his family. Remember this dialogue from Season 2, Episode 1:
WALTER WHITE: Adjusting for inflation – good state college – adjusting for inflation. Say $45,000 a year, two kids, four years of college... $360,000
Remaining mortgage on the home, $107,000. Home equity line, $30,000, that's $137,000. Cost of living, food, clothing, utilities, say two grand a month?
I mean, that should put a dent in it, anyway. 24K a year provides for, say, ten years. That's $240,000, plus 360 plus 137... 737. $737,000, that's what I need. That is what I need.
Walt assumed that his cancer will quickly kill him (and wasn't wrong, he had roughly two somewhat healthy years left past his diagnosis) so he needed a lot of money to leave for his family. In 2008 a great salary for a chemist might be $150,000 after taxes. Deduct living expenses and Walt might be able to leave $200,000 to his family, which was clearly not enough.
Yes, there was absolutely an element of pride involved as explained in the other answers, but the job offer was also not enough to cover what Walt wanted for his family.
Gray Matter could have provided a high salary and potentially covered his medical expenses.
He already had insurance from his job as a school teacher that would've covered 'standard' medical treatment. The only reason he needed extra money for treatment was because Marie insisted on him going to the most expensive clinic in the state that wasn't covered by his plan, which he likewise resented:
Marie: Okay. So first thing tomorrow, I talk to my radiologists, we find you the best oncology dream team.
...
Skyler: Yeah, anytime on Friday is absolutely fine. Thank you so much for working us in. Can I just put that on a credit card? Great. Perfect. Okay, so we will see you at 10:45 on Friday morning. Thank you so much. The best oncologist I mean, not even just in New Mexico, but one of the top ten in the entire nation. His name is Dr. Delcavoli. And we see him on Friday. I mean, Marie really came through for us. She had her boss call and this is good. From here on out, things are gonna...
Walter: What's that we're putting on a credit card?
Skyler: It's just a deposit kind of thing.
Walter: How much of a deposit?
Skyler: It's $5,000.
Walter: Five thousand? And what's that? Just to start? Just to tell me
what I already know?
Skyler: Walt, he's not in our HMO, okay? So be it. We'll figure it
out. Come on. Don't get hung up on money here. We can always borrow
from Hank.
Walter: Absolutely not. No, I just, we're not gonna do that.