Weird D5100 shutter speed?

I play around with shutter speed in Mode 'A'. This is what I notice. Without an external speedlite or with the built-in flash 'OFF", the shutter speed can be set as high as 1/4000. But as soon as I pop up the flash, the shutter speed immediately go down to 1/200 and that's the highest. Shouldn't it be the other way around, because higher shutter speed needs more light for correct exposure? That's weird. I just bought my D5100 about 3 weeks ago and WAS very happy about it, until I found this high speed sync problem! And to make it worst, today, I just bought a high speed sync Yongnuo speedlite, YN-568EX, only to find out my investment in the speedlite was useless. Should've just bought a cheaper YN-565EX instead. My Q is, Is that normal for Nikon D5100? Or is there something wrong with my D5100?

All cameras have a maximum flash sync speed.
For some cameras, it is 1/200. For others it can be higher (My 1D has a sync speed of 1/300)

The focal plane shutter has a leading curtain and trailing curtain. During an exposure the leading curtain opens. Then the trailing curtain closes. At up to a certain speed the sensor or film plain will be exposed completely. The maximum speed at which that occurs is called the x-sync speed. At higher shutter speeds the trailing curtain is closing which the leading curtain is still opening. Total exposure time is decreased as what is essentially a slit between the curtains passes over the focal plane. Normally the electronic flash takes less than 1/1000th second. If it flashes with the shutter speed faster than the x-sync speed you will see only part of the sensor plane exposed by the flash, and part masked by the leading or trailing curtain. On your D5000 the x-sync speed is 1/200th second. With a flash designed to work with your camera's electronics in TTL mode, the camera will know if there's a flash mounted and turned on, and it will not let you exceed x-sync.
Some high end bodies and flashes have a menu setting that allows FP flash. This gives the flash a slower steadier burn that can illuminate the focal plane while the shutter slit is passing over it in the higher shutter speed settings. I have experimented with this a little with my D90 and SB600. Maybe it has some usefulness, but not a lot, because the flash is not very intense in this mode.
Anyway, what you have seen is normal. If you get a cheaper flash with no TTL communication with the camera, you can set your shutter speeds higher, but the high speeds will get you the masking effect that makes that useless.

Normal (for the D5100 as well as most DSLRs).
Flash systems can only be used up to 1/200 sec.
Here is a tutorial on why this is so. It is easier to have you watch it than try to explain it:
However, higher end Nikons (D90 and up) and certain Nikon Speedlights can use a special mode called "FP High Speed Sync" that can be used up to 1/4000th of a sec.
FP High Speed Sync essentially lengthens the time the flash is active.
- Street Lamp Photography exposure? Higher ISO & Lower Shutter Speed or Lower ISO & Higher Shutter Speed?
- Street Lamp Photography exposure? Higher ISO & Lower Shutter Speed or Lower ISO & Higher Shutter Speed? - 1
- My Nikon D5100 shutter sound is weird?
- Increasing shutter speed of Nikon D3200 while using the built-in flash or a speed-light?
- How to speed up the shutter speed?