klashsama, put a spoiler on that. Also, you've may have misconstrued the ending.
He didn't die. He had brain surgery, somewhere along the line there may have been a complication, causing him to lose control of his legs. It is assumed they lived happily together afterwards because Tomoya went through rehab to regain that control. Check your CG list, there's an imagine of Tomoyo assisting Tomoya with walking.