Reading the verses before and after, it gives us:
40:10
Indeed, those who disbelieve will be addressed, "The hatred of
Allah for you was [even] greater than your hatred of yourselves [this
Day in Hell] when you were invited to faith, but you refused."
40:11
They will say, "Our Lord, You made us lifeless twice and gave
us life twice, and we have confessed our sins. So is there to an exit
any way?"
40:12
[They will be told], "That is because, when Allah was called
upon alone, you disbelieved; but if others were associated with Him,
you believed. So the judgement is with Allah , the Most High, the
Grand."
40:13
It is He who shows you His signs and sends down to you from
the sky, provision. But none will remember except he who turns back
[in repentance].
40:14
So invoke Allah , [being] sincere to Him in religion,
although the disbelievers dislike it.
So the verse, in it's context it is clear that the disbelievers that associated partners with him; when being brought back to life, they ask: "So is there to an exit any way (from the punishment)?"" The answer will then be "When you were told to only worship Allah, alone, you disbelieved! You would only believe if other partners where associated to him!"
I hope it helps. As Medi1Saif said, you should always try to read the verses in context, it will become much clearer. And looking for tafsir about what other scholars have said and why these verses was revealed is also a good thing to do. I didn't find anything in the Asbab Nozol (reasons for revelation) book I got at home.
Tafsir Jalalayn
[40:11] They will say, ‘Our Lord, You have caused us to die twice, two deaths, and You have given us life twice —
for they were lifeless drops of semen, then they were given life, then made to die, then brought back to life
for the Resurrection. We [now] confess our sins, in having disbelieved in the Resurrection. Is there then any
way to go out?’, out of the Fire and return to the world to be obedient to our Lord? The answer given to
them will be: No!
[40:12] That, namely, the chastisement which you find yourselves in, is because, during [the life of] this world,
when God was invoked alone, you would disbelieve, in His Oneness; but if partners were ascribed to Him, you would believe, you would accept such idolatry. So the judgement, to chastise you, belongs to God, the
Exalted, above His creation, the Great, the Tremendous.