i stated earlier that doubt will either increase one in faith as a result of investigation, or it will lead to disbelief and since one of the 2 outcomes is a great sin, the greates in islamic perspective, then it is something that is discouraged since you do not know if you will end up disbelieving or increase your faith. if one turns to disbelief then his home is hell, an everlasting punishment. Allah does not forgive those who associate partners to him, so he is giving a warning. whether you disbelieve or not makes no difference to Allah, if it did then why would he allow disbelievers to live on earth?
He also does forgive doubt, he just doesn't forgive one who dies in a state of disbelief, in one of my earlier posts i made an example of Imam Bukhari and his quest to find separate the true Ahadith from the fake ones, i will repost that once more for you.