Fruit sugar, called fructose, makes fruit taste sweet.
Your taste is one of the five special senses. When we taste something, our chemical receptors, called chemoreceptors, in our tongues get stimulated by certain chemicals and send impulses to our brain in our central nervous system.
Here in the brain, the impulse travels through different areas. The first stop is in our limbic system and is interpreted as either good or bad by the amygdala. Then our memories are searched in a place called the hippocampus to determine if it is familiar. If it is, then our memory banks are searched for our previous responses to this stimulus. The next stop is the central relay station called the thalamus. From here is is routed to the appropriate place in a higher center in the cerebrum called the sensory lobe, or parietal cortex. It is here that we finally become aware of the taste of sweet.
In general, our bodies and our brains are pre-programmed to interpret sweet things as good for us, thus the pleasure we experience when we consume things like fruit. And, things that are quote "bad" for us to taste bad, like bitter things. However this may backfire and not always be a good barometer for what we should consume, because we can make processed food taste good with additives, but it may not be good for us. For example artificial sweeteners may fool your brain to think that just because it tastes good it is good for you when they have been linked to certain health risks.
In conclusion, fruit tastes sweet because our brains interpret the sensation from the sugars in it as pleasurable.