The designers admit the table's unclear
The first sentence in the spell prismatic wall's Effect of Color column occurs to effects from beyond the wall attempting to pass through the wall, while the second sentence in the Effect of Color column occurs to a creature itself when it attempts to pass through the wall. (The same applies to the spell prismatic sphere, too.)
Hence a creature with spells cast on it keeps those spells after penetrating the wall's sixth indigo layer much like, for example, the creature keeps its mundane ranged weapons after penetrating the first red layer and keeps its breath weapon after penetrating the wall's fourth green layer. The sixth, first, and fourth layers stop, respectively, spells, mundane ranged attacks, and breath weapons from beyond the wall from penetrating the wall; those layers don't also affect in those first sentences' ways a creature attempting to pass through the prismatic wall!
Pathfinder creative director James Jacobs in a 2010 Paizo messageboard post says
Objects, in this [prismatic wall] case, refers to nonmagical non-living things that are used to try to breach the wall. Like thrown rocks, thrown tables, arrows, catapult boulders, and so on. Any objects or items or whatever that are "attended" (as in, carried or worn by a creature) are NOT destroyed, but travel with the person carrying/holding them off to whatever other plane that person ends up going to. If the person makes their Will save to avoid being sent to another plane, he can stroll right on through the wall with all his stuff intact.
Allowing prismatic wall to automatically destroy every object that passes through it, in other words, IS a bit excessive. The intent of the spell is to prevent anyone from making ranged attacks with weapons or spells or abilities against those on he other side, basically, not to provide a static disintegration wall. The limitations of the table format forced us to be a bit more brief than we should have been in describing it, alas.
Artifacts can't be destroyed by a prismatic wall unless the Destruction line of the artifact says otherwise.
Thus the prismatic wall's layers have "their effects on creatures trying to attack you [with effects from beyond the prismatic wall] or [on creatures that] pass through the wall[, respectively]." However, this reader had to add all that bracketed information because, as Jacobs says, "The limitations of the table format forced us to be a bit more brief than we should have been in describing it, alas." (And that alas dates back to, like, at least the 2003 D&D 3.5e's description of the spell prismatic wall.)
For example, a typical creature that attempts to pass through the wall is dealt between 70 and 140 points of damage, and must make saving throws to avoid being poisoned, petrified, driven insane, and being sent to another plane, but the creature suffers none of the layers' other effects!
The creature, when passing through the wall, does not, for example, also see its mundane and magical ranged weapons destroyed by the red and orange layers, respectively, nor does the creature scratch its breath weapon off its character sheet because of the green layer, or see its spells dispelled by the indigo layer. Those layers simply stop those attack forms when launched from beyond the wall from reaching past the wall.
In other words, spells on the creature remain intact if the creature gets through the indigo layer of the prismatic wall, but spells from beyond the wall won't affect past the wall because the indigo layer stops all spells.
I could find no developer commentary explaining why the spells needed to drop a prismatic sphere's or prismatic wall's layers were picked for any edition of Dungeons and Dragons that preceded Pathfinder, and Dungeons and Dragons 3.5e is whence Pathfinder takes its prismatic sphere, spray, and wall.
The prismatic spray originates with Vance…
Vance's short story "Mazirian the Magician" (1950) is the prismatic spray spell's source:
Mazirian made a selection from his books and with great effort forced five spells upon his brain: Phandaal's Gyrator, Felojun's Second Hypnotic Spell, The Excellent Prismatic Spray, The Charm of Untiring Nourishment, and the Spell of the Omnipotent Sphere. This accomplished, Mazirian drank wine and retired to his couch.…
[Much later] Mazirian shook off the [foe's] spell, if such it were, and uttered a spell of his own, and all the valley was lit by streaming darts of fire, lashing in from all directions to split Thrang's blundering body in a thousand places. This was the Excellent Prismatic Spray—many-colored stabbing lines. Thrang was dead almost at once, purple blood flowing from countless holes where the radiant rain had pierced him.
As can be seen from the description, Vance's the Excellent Prismatic Spray spell doesn't much resemble the effects of the D&D spell prismatic spray (from which Pathfinder drew its spell of the same name). Further, I've found nothing to indicate that the prismatic spray spell's effect was changed to distance it from Vance's creation, or, instead, that the spell was named as an homage to Vance's invention, or, really, anything much about the spell's development at all. But it's an almost inconceivable coincidence that the name's accidental, given Gygax's affection for Vance's works.
…But the prismatic wall and prismatic sphere don't seem to
While in the same story Mazirian uses the Spell of the Omnipotent Sphere, the D&D spell prismatic sphere doesn't seem to owe Vance's spell anything:
He called his charm, the Spell of the Omnipotent Sphere. A film of force formed around his body, expanding to push aside all that resisted. When the marble ruins had been thrust back, he destroyed the sphere, regained his feet, and glared about for the woman.
To this reader, that sounds closer to (but still different from) Otiluke's resilient sphere or something.
Thus it's my understanding and the understanding of others far more well-informed than I that the spells prismatic sphere and prismatic wall were created created wholecloth for Dungeons and Dragons, with no fiction serving as inspiration. Some things are just new, I guess.
Research notes
Originally—that is, in the Player's Handbook (1977) for Advanced Dungeons and Dragons, which is as originally as I can muster—the necessary spells were, in order of layers dropped, cone of cold, gust of wind, disintegrate, passwall, magic missile, continual light, and dispel magic.
However, in order of spell level for magic-user—AD&D's wizard—, these are as follows: 1st—magic missile; 2nd—continual light; 3rd—dispel magic, gust of wind; 5th—cone of cold, passwall; and 6th—disintegrate. This comes really close to a magic-user needing to devote one spell per spell levels 1st through 6th to drop a prismatic wall or sphere. (The last layer's being dropped by dispel magic remains an outlier but a reasonable one.) It'd be great if I could find a version of passwall or cone of cold that was, instead, a 4th-level spell, but, alas, I can't. (Even the 1974 Dungeons and Dragons puts its spell pass-wall as a 5th-level spell and lacks the spell cone of cold entirely!)
Were the spells needed to bring down a prismatic sphere or wall to equal one spell per spell level, this would be a predictable and interesting design choice, but there appears to be no point in mandating two 5th-level spells and one 6th-level spell: A level 10 magic-user can cast two 5th-level spells but no 6th-level spells, yet a level 12 magic-user can cast four 5th-level spells and one 6th-level spell, more than enough to drop a prismatic sphere or wall and have spells remaining!
Thinking this might be campaign-dependent, I looked for AD&D liches. While liches are (thankfully!) rare, encounters with level 17 magic-users in AD&D are rarer, and I thought perhaps an early adventure module might be geared toward level 12 or higher PCs encountering foes who could cast prismatic sphere or wall. But, for example, Asberdies, the infamous lich from Descent into the Depths of the Earth (1978) that's for levels 9–14, doesn't memorize prismatic sphere or wall, nor do the two liches (and, incidentally, the ki-rin) from the Rogue's Gallery (1980) (which includes PCs from Gygax's campaign). The spells needed to drop prismatic layers appear oddly—but, perhaps, appropriately—random. (I mean, seriously, what magic-user memorizes continual light instead of stinking cloud?)
In Dungeons and Dragons, Third Edition makes some changes, but keeps the same weird non-pattern. The spells, in order of layers dropped, become cone of cold, gust of wind, disintegrate, passwall, magic missile, daylight, and dispel magic. While some names changed, spell levels didn't, so that, in order of wizard spell level, this is as follows: 1st—magic missile; 2nd—daylight; 3rd—gust of wind; dispel magic; 5th—cone of cold, passwall; 6th—disintegrate. The Dungeons and Dragons 3.5 revision swaps the spell levels of daylight and gust of wind, keeping intact the same non-pattern.
Spell level isn't the connection. Spell school isn't the connection (a spell from each school would've been just as convenient!). Expected character level seems to have no impact. It doesn't appear to be a puzzle, either, as there's no reasonable acronym or initialism or apparent code. Some stuff we may just never know unless a designer deigns to reveal his secrets.
Best Answer
How do you want your spells to work?
In the PHB section on Spellcasting, we see that:
Your initial assumption is:
It seems to me that you are conflating the issue of choosing a spell target (what must be present for the spell to be cast) with resolving what classes of things a spell may legitimately affect after it is cast. Just because a spell requires you to choose 'a target to be affected by the spell's magic' does not mean that this target is the only thing that the spell affects or can harm.
In particular, for 'area of effect' spells (like cone of cold), the target you choose is the spell's point of origin; after this, the spell can then affect things within its 'area of effect' without you having to choose them and without them being specified as targets. These other things might be called 'targets' in the spell description, or they might not. For example, fireball explicitly says that it can damage creatures, and calls them targets, but it also explicitly says that it ignites flammable objects, while not calling them targets. Flame Strike, on the other hand, explicitly damages creatures, but the creatures are not called targets.
As above, "A spell's description tells you whether the spell targets...a point of origin for an area of effect". For an area of effect spell, the only target you choose is the point of origin; for what the spell affects you need to read the spell description.
Cone of Cold says:
We know that this is an area of effect spell, so the target you choose is the point of origin of the cone. For what else can be affected by the spell, we need to read the spell description. We can see that the spell explicitly affects creatures, but could it affect other things?
Here you have a fundamental choice to make - are you reading the spell description in a prescriptive way or a descriptive way? A prescriptive reading would take the spell description to mean that it does exactly and only what it says it does. A descriptive reading would use the 'no flavor in spells' principle to construct other effects not explicitly spelled out so long as they were not excluded by the spell description or other rules, following the principle of 'the DM describes the results of your actions'.
Both of these approaches are RAW, and both have their advantages and disadvantages. The prescriptive approach has the advantage of being very clear in interpretation and more uniformly applied across DMs, which is important in situations like Adventure League play. Unfortunately, in cases like this (can a cone of cold damage the red layer of prismatic wall?) a prescriptive reading produces the result of 'the rules are stupid, so ignore them'. A prescriptive reading admits that yes, the spell produces a blast of air that is objectively cold, but then says that this blast has no further effects because the spell does not explicitly state them.
A descriptive reading, on the other hand, is more subjective. Since the spell says that it produces a 'blast of cold air', each DM will have to determine what the subsequent effects of this blast are, because it is just as much an effect of the spell as the explicit damage to creatures is. However, the descriptive approach has the advantage of using RAW to get the much more satisfying result of the cone being able to take down the wall.
How cold is this blast of cold air? It is so cold that it does 8d8 cold damage. What kinds of things would this damage? Anything in its area of effect that is capable of being damaged by cold. We know that it damages creatures, because the spell description says that it damages creatures, but it does not say it damages only creatures, so with a descriptive approach we are free to consider other possibilities.
Can this cold damage objects? No, because objects are immune to effects that cause Constitution saves (as per the general rule on PHB 185).
Can this blast of cold air cause environmental effects? Could it frost over the surface of a water trough, cause condensation droplets to form on beer steins, or blow loose papers off a desk? A descriptive reading would say sure, the DM describes the results of the players' actions and any of these effects are fair game, so long as they don't rise to the level of 'causing damage to an object' which is prohibited as above. A prescriptive reading would say that none of these effects are possible because they aren't explicitly permitted by the spell.
The red wall of Prismatic Wall is neither a creature, nor an object; it is a spell effect. Spell effects are special, and in their descriptions they state what they can be damaged by, if anything. A spell effect that does not specifically say it can be damaged by cold would not be damaged, but a spell effect that says it can be damaged by cold will be.
Prismatic Wall says:
When the cone of cold intersects with the wall, we have a spell effect whose description says it does 8d8 cold damage overlapping in space with a spell effect that says it is destroyed by 25 points of cold damage. Because the wall is not a creature, it does not get a save. Because the wall is not an object, it is not immune. Because the wall says it can be damaged by cold, it can be. 96% of the time, the wall will be brought down by the first cone of cold cast.
Thus, a descriptive reading of the spell gives us the answer that we intuitively want anyway, and still supports the RAW framework of the game. I think that is pretty useful.