Don't worry about why. If you try to only fix the problem, you may miss something. Worry about getting it correct!
Black == HOT
White == Neutral
bare == ground
(in North America -- Europe is different!)
Open it up again and make sure it is connected as follows:
- white from panel to white from outlet to white from light
- black from panel to black from outlet to black from switch
- white from switch to black from light
- all grounds together (and to box)
The wire going to the switch has no neutral in this case. The black wire is "always hot" and the white wire is "switched hot". I like to wrap black electrical tape around the end of the white insulation (without covering the copper wire) to indicate that, despite being white, it is not actually "neutral".
Speculation on how it was mis-wired: (copied and corrected from my own comment later on) If removing the ceiling bulb made the outlet light not work at all, then you were getting some sort of current flow through the bulb. So yes, you must have had it in series. CFL has circuitry so could perhaps pass more current while starting up (hence the increase in brightness of the outlet light for a second) after turning on the switch. As for where the power was going when the switch was off... It could be that the CFL was "absorbing" and "returning" some small amount of current (a capacitive load), enough to lightly switch an LED light; they don't need much.
Given the capacitors and inductors involved in even a simple circuit for a CFL, it's not unimaginable that this is possible. I don't have an LED night-light to test this but you could do this yourself.
If properly wired, the smaller prong of a plug is the hot wire. Bend the larger prong of the night-light or otherwise set it up so that only the "hot" prong is connected. Then touch the exposed prong to the side and/or tip of a CFL and see if the night-light lights.
As a more personal example... Think of standing on a rubber mat (or wearing rubber-soled shoes) and touching the hot wire with your finger. Don't do it -- just think it! You'd feel a "buzz" even though you're not grounded or touching a "neutral" wire. Most of us can relate to this from some experience in our past. Your body has a capacitance and will absorb and return electrons as the voltage in the hot wire oscillates at 60Hz.
This is how a typical receptacle/switch combo is wired.
A combination GFCI/switch, is going to have a different terminal layout. First, the switch terminals are no longer on the device. Instead they're a couple wires shooting out of the device.
Next you'll notice a set of terminals labeled LINE, with a brass terminal on one side, and a silver on the other. There will be another set of brass/silver terminals, but these will be labeled LOAD (these are typically covered by a sticker).
When wiring the GFCI/switch combo, it will look something like this.
The challenge you'll face, is determining which black wire is "hot", and which is "switched".
Best Answer
If the outlet tester said the outlet is not grounded, it is not wired properly.
The three black wires are not the problem. this is a common technique for bringing power to an outlet and then continuing the power down the line to other outlets or fixtures.
The connection between the outlet and the switch may be one of two things: - if the switch is downstream (further away from the power source) the outlet is passing current to the switch and then on to a fixture. - if the switch is upstream (between the outlet and the power source), the outlet, and everything else powered by the black wires shown, are controlled by that switch. It is not possible to tell from the wiring shown.
The white wires in the background may be correct, but it is hard to be sure from this picture.
The real problem is the lack of ground. There should be a green or bare wire in the outlet box. This wire needs to be attached to the grounding screw of the outlet. If it is already attached to something else in the box, you need to remove the grounding and attach two pigtails to that ground and then attach tem to the other grounded item and the outlet.
Given the information in your question, it sounds as if you have little experience in handling electricity. It might be advisable to have this project done by someone with a bit more experience while you look on and become more familiar with power.
Above all, make sure that the power to all wires in the box is off (test with a non-contact tester) before attempting anything.