I think he is just feeling very low at the moment because of the frustration of losing both tasks, having tried so hard to win them, but now they are all united as one camp I think he will get over it and be OK.
Every year you see celebrities reach a low point and threaten to walk out, but they usually get talked out of it by their camp mates and stay until they get voted out by the public. I hope Matthew will stay as it would be such a shame if he gave up now after battling so hard to win those tasks and losing by such a narrow margin.