What does "spoil" mean in this sentence?'That's a perfect plan, Gabriel, spoiled by one tiny detail'
The entire sentence from TV show:
"That's a perfect plan, Gabriel, spoiled by one tiny detail. We've yet to secure the services of the hat shop stunner."
Is the use of this word out of date? I can hardly find a matching defintion from dictionaries.