Here's why:
* Intransitive verbs do not take a direct object. They express a complete thought without needing to act upon anything.
* Transitive verbs require a direct object to receive the action of the verb.
In the sentence, "was" is a linking verb, connecting the subject ("rainbow") to the predicate adjective ("spectacular"). It doesn't take a direct object.
The sentence simply describes the rainbow, not an action it performs on something else.