Yes, you wired it wrong. :)
The red wire is another hot leg. This is a common installation when the electrician is providing wires for a ceiling fan with lights (to be independently switched). The red wire shares a common neutral with the black wire, hence the three white wires. You should keep the white wires connected. Disconnect the red wire and cap it off. There should also be a bare copper or green wire in there (maybe screwed to the back of the box if the box is metal). This wire is your ground.
Update:
As @Isaac Kotlicky pointed out, the red wire could be the switched wire. But your switch could also be miswired. Take a look at the switch to see what colored wires are going into and out of the switch. A picture would not hurt.
As far as your safety ground is concerned, you really should have a bare copper or green wire in the box. If not, it's possible that the gfci switch is making up for the weakness of having no ground wire. Make sure you test the GFCI device once you get this together and working. Another possibility is that you have metal conduit leading to the box, and it is grounded. In either case, you could simply attach the fixture ground to the metal box.
Here's my best guess at the wiring based on the photo. Looks like you've got one hot/neutral coming into the box from the panel (or another switch/outlet), and you've got 2 hot/neutrals going out of the box to other switches/outlets. Since these are all joined together, it doesn't really matter which one is coming in and which two are going out.
Then it looks you you have a white wire connected to the bundle of hot wires, and that white is going out of the box to the switch, and then a black wire returning from the switch, which goes to your lamp. This is pretty common, but that white wire should probably be marked at both ends to indicate that it's actually a hot.
Based on what I can see in the picture, you do not have a ground wire. It's possible that the box itself is grounded, either with a ground wire screwed to it that's not visible in the photo or by metal conduit, but based on the yellowed insulation of the white wires, my guess is that your house is old enough that no ground was required at the time, so there is not ground wire.
![enter image description here](https://i.stack.imgur.com/928aB.png)
Update based on your close-up picture, there are ground wires, they are sort of terminated to the box on the strain relief clamps. If you have enough slack, it would be good to wirenut them all together securely with one pigtail that goes to the box and one to your lamp. Otherwise, make sure they are all securely fastened to the box, only one of them (the one that leads back to the panel) is a "real" ground, the others are providing ground for downstream lights/outlets, so make sure that all all them are securely fastened.
Best Answer
The two bare wires are your ground wires, but they are not installed properly according to current codes (even though as long as the screws remain tight it should provide sufficient fault protection).
To be installed properly, there should be a "pigtail" from under one of the screws in the back of the box connected with a wire nut to the two ground wires AND the ground wire from your light fixture. That's a total of four wires in a wire nut.
The one on the left is horribly short. The one on the right is even shorter. Since you may be unable to connect them properly, you can try leaving the one on the right as is. There may be enough slack on the one on the right that you can pigtail it as described above (three wires in a wire nut).
Never wrap more than one wire under a screw. It's nearly impossible to get a solidly reliable connection with more than one wire under a screw, unless it's the type that has a clamping plate and is designed for more than one wire, but in that case you're not wrapping the wire around the screw.
If you find it impossible to use a wire nut because the wires are so short, go to Home Depot or Lowes and get some push-in connectors. They're similar to wire nuts, except you push the wires into holes (one wire per hole) like into the back of an outlet. (I don't like the "backstab" connections on outlets, and I'm suspicious of these connectors, but in this situation it may be the best option.)