First off let me say that the first line in 5.2.2 is wrong or misleading when it says "spectral response curves, one for each of red, green, and blue, as emitted by the display". A "spectral response curve" is the property of a sensor, such as the human eye or a camera sensor, which responds to light. For an emitter of light such as a display, the equivalent is an "emission curve" or more commonly "spectral power distribution (SPD)".
The XYZ values are the device independent specification of a colour, and can be calculated using the specific spectral response curves called colour matching functions (CMFs). The XYZ system is defined that any real colour will have X, Y and Z values in the range of 0 to 1, though not all combinations of values in that range are physically possible colours.
The CMFs are available from the Colour and Vision Research laboratory here http://www.cvrl.org/, under the "CMFs" link. They look like this, with the X CMF displayed in red, Y displayed in green and Z displayed in blue.
You can combine any SPD with these CMFs to get the XYZ values of that SPD, that is what the function is doing. By multiplyng the amount of each wavelength emitted by one of the RGB emitters in the display with the response strength of the CMF and summing them together, you calculate the total response to that emitter. By doing this for each of the X, Y and Z CMFs you get the XYZ value of the colour of that emitter.
For sRGB monitors these should be approximately (in XYZ order):
R: (0.4124564 0.2126729 0.0193339)
G: (0.3575761 0.7151522 0.1191920)
B: (0.1804375 0.0721750 0.9503041)
If you look at the values in the RGBToXYZ function you will see these approximate values in the matrix, but arranged vertically rather than horizontally.
Many different SPDs could give these same XYZ values, but any SPD with the same XYZ values should look the same to the human eye, so it does not matter that different monitors have different SPDs, as long as they have the same XYZ values.
Once you have these values for the monitor, you can convert any colour's XYZ values to the required RGB values using the XYZToRGB function. If all three values are in the range 0 to 1, you can display the colour on the monitor. If any value is outside of the range of 0 to 1, then the colour is outside of the gamut of the monitor, and cannot be displayed accurately on that monitor.
The reason for doing this is to convert an SPD to three values in RGB or XYZ, which is much easier to manage than the full detail of the SPD, and in most cases is an adequate description of the SPD. You can just sum the XYZ values for each SPD multiplied by the linear RGB value for each to get the resulting total XYZ, which is much simpler than calculating the combined SPD and then calculating the XYZ of the combined SPD, but will give the same answer.
One last note, throughout the article you refer to and this answer, RGB values are given as LINEAR RGB values. In practice RGB values are usually given as GAMMA-ENCODED RGB values for efficiency, so there is an additional step you would need to do in practice to convert the values.