Here's a guess at what goes wrong for general schemes. For simplicity, let X be a non-affine scheme; say it's the union of two affines: A1 and A2 (although I'm actually thinking of $\mathbb A^2 \backslash {0}$), and let's try to define the product $Y=\prod_{i=1}^\infty X$.
Well, we should be able to describe Y as a union of affines (that are glued along some maps). What should these be? There are two "obvious answers". If we carry over our intuition from topology, these affinesthe natural building blocks should have the form $U_1 \times U_2 \times \ldots$ where each $U_i$ is one of $A_1, A_2$, or $X$ and all but finitely many $U_i$-s are equal to $X$. However, these products are not affine (they aren't really defined as schemes, but since $X$ is not affine, they are even "intuitively" not affine).
The second "obvious answer" would be to take products $U_1 \times U_2 \times \ldots$ where each $U_i$ is one ofeither $A_1, A_2$$A_1$ or $A_2$. These would be affine, but this feels like a wrong answer,: it would be like using the box topology on an infinite product. They shouldn't even be open in Y (I know, this is rather far-fetched since Y is not yet defined). Also, if you tried to glue Y out of these, I doubt you'd be able to define gluing maps (they are maps from an infinite product to an infinite product - I feel this is bad, but can categorically minded people confirm?).
So far, I don't have an actual proofproof that the second answer is bad, or that you couldn't define Y with some other affines, but I think there should be a good reason (the same reason as to why we use the product topology for topological spaces, though it eludes me at the moment).