That's just how radars work.
A radar works by sending pulses of radio waves and measuring how long it takes for them to be reflected back. If you know the speed of light within air, you can then calculate how far the radio waves have traveled, and from that, you know that the aircraft is half that distance away from the radar.
This is not terribly useful, though. You could either build an omni-directional antenna, which sends and receives pulses in all directions. Then you can tell the distance to every aircraft around you, but you can't tell where they are. Or, you could build a directional antenna, then you know that any reflection you get must be coming from the direction the antenna is pointing … but you can only detect aircraft which are in the direction of the antenna.
To solve this problem, radar combines the two approaches above: it uses a directional antenna which can only detect aircraft in one direction, but this antenna is put on a rotating mount. This way, you can tell both the direction and the distance of an aircraft.
One further trick you can do is measure the Doppler shift of the return signal. This tells you the aircraft's relative speed component in the direction of the radar. Note: it does not tell you the aircraft's actual speed, nor does it tell you its velocity vector. You can only tell how fast the aircraft is moving towards or away from the radar antenna – any movement sideways will not be detected.
As a last trick, a computer can integrate measurements from several rotations of the antenna. This allows you to tell which direction the aircraft is moving and how fast.
You will note that one thing was not mentioned here: altitude. A radar can measure distance from the radar. If it is rotating, it can tell direction relative to the axis of rotation. If it measures Doppler shift, it can measure speed along the radial. If it integrates measurements over a period of time, it can measure velocity relative to the axis of rotation.
However, all these measurements are always relative to the axis of rotation, and usually, radars rotate around a vertical axis, thus they "scan" horizontally.
In other words: a radar cannot measure altitude. So, it should not be surprising that altitude data from a radar is unreliable.
Note: all that I wrote here applies to so-called primary radar. Modern air traffic control relies on so-called secondary surveillance radar (SSR). This is really a misnomer. SSR doesn't work like a primary radar at all, it is actually a simple wireless data-link protocol. The "radar" sends out an interrogation message and the aircraft replies with a data message. Which data is included in this message differs based on exactly what protocol the radar and the aircraft's transponder support.
The response includes at least some form of identification (either the 16 bit transponder code or the 24 bit ICAO address). In almost all cases, it also includes the aircraft's altitude. It may also include position, direction, and velocity.
However, crucially, it requires the aircraft to be cooperative. If the pilot turns off the transponder, SSR will not work.