The expression would that it were implies a wishful or idealized alternative to an undesired reality. In other words, the speaker wishes for a different set of circumstances or outcome than the real situation he or she is in. Sometimes the expression is extended to "would that it were so" or "would that it were true." All of these variants still suggest a strong desire for at least one change in the present circumstances. When a talented athlete becomes injured and has to be replaced during an important game, for example, the teammates may strongly wish he or she were healthy enough to perform. The coach could respond with "Would that it were so, but we don't have that option right now." The speaker agrees with the sentiment, but also realizes that a desired change could not take place in reality.
Expressions such as this are prime examples of what English instructors call the subjunctive mood. A sentence written in a subjunctive mood implies a wishful state of being or a hypothetical situation. Many times such a sentence is prefaced with words such as would, could, should and if. A teacher might tell his or class that should school be canceled the next day, students would have an extension on their projects. These are not statements based on facts, but rather conditions based on possible or hypothetical conditions. "Would that it were" accomplishes the same thing by implying a theoretical or hopeful condition.
Some may even read more into such a subjunctive statement. The speaker is not only acknowledging a hypothetical alternative, but is also suggesting the alternative would be preferable in some way to the reality. The coach really would rather have the injured player back on the roster rather than rely on a less experienced substitute, for instance. In a sense, the speaker is agreeing with the conditional or hypothetical statement, but must resign himself or herself to a less desirable reality. If the reality means a loss or a setback, it would not be unusual for a person to wish for a viable alternative. Many people use the American expressions in a rueful or nostalgic sense, hoping against hope that a situation or circumstance could be altered.
Many foreign-born speakers find it difficult to grasp the concept of a subjunctive mood in English. Many of the standard subject/verb agreement rules change whenever the sentence's mood shifts to the subjunctive. The shift from "was" to "were" in the expression, along with the modifying "would," indicates a change from the real to the conditional, which can be very confusing for beginning and non-native English speakers. This is why most English grammar instructors drill their students on the subjunctive mood along with the reality-based indicative mood. Idioms such as this are ideal examples of the difference between subjunctive and indicative moods.