So far, we have gotten rovers on Mars to take samples and analyze them and send data back to Earth. However, why haven't we gotten a rocket to land on Mars, collect a sample, and blast it off back to Earth? Surely we can learn much more using our better equipment on Earth and we don't have to worry about what equipment we need to pack on the rover because of weight.
You said it yourself when you mentioned weight. So far, we managed to soft land roughly two metric tons on Mars in one go, if we count both the Curiosity rover and its Sky Crane landing system (Curiosity itself is about one metric ton in mass, but both the rover and the Sky Crane actually achieved close to zero vertical velocity with respect to the martian surface before the rover was released). Now consider how much mass it would take to also launch something back.
From Mars surface, required delta-v to launch something into orbit is roughly half that required to launch something from Earth to low Earth orbit, so ~ 6 km/s (your mileage might vary, depending on launch site's altitude, latitude,...). Once in Mars orbit, you require additional ~ 3 km/s to launch something into most energy efficient Hohmann transfer orbit towards the Earth. So we'd need a launch system capable of achieving roughly 9 km/s in likely two or more stages. With just the one stage needed on the surface, that's still quite a rocket even if the payload is fairly small. Depending on its performance (e.g. specific impulse of propellants used), its mass would be over 100 times what we so far managed to land on Mars in one go, if it later docks with an orbital stage to return the capsule with samples back to Earth.
Mind that even the upcoming Mars 2020 Rover will only stash samples (that's the plan so far), and they might, or might not ever be recovered for launch to Earth. I'm afraid it's simply too difficult to bring Mars samples to Earth, and we don't really have the necessary technology at this point in time. When it comes to samples from Mars, for the moment, we're stuck with either meteorites that have been established to have come from Mars, or analyzing them there, in-situ, with probes, landers and rovers, and remote observations with orbiters and flyby missions.
Some additional comments:
A lot of the mass that needs to be landed on Mars could be reduced with in-situ production of propellants (what's commonly referred to as ISRU - In-Situ Resource Utilization), perhaps just the oxidizer by electrolysis of the atmosphere to extract oxygen like the MOXIE (Mars Oxygen ISRU Experiment) on the Mars 2020 Rover will attempt to demonstrate on a tiny scale, which would constitute over two thirds the mass of a liquid hydrogen and oxygen stage, and seems a lot simpler to do than finding and purifying sources of hydrogen for rocket fuels with no infrastructure there to do that. But even that still means landing a lot more mass than we currently know how to, and holding onto hydrogen as fuel or a fuel component, which, because it's in tiny molecules and doesn't particularly appreciate thermal cycling, really likes to bleed-off through light and thin walls of rocket propellant tanks. Perhaps using imported hydrogen to produce hydrocarbon fuels with the carbon from the mostly carbon dioxide atmosphere, such as methane, would improve shelf life and improve performance of such rocket stages despite lower specific impulse better than shielding cryogenic liquid hydrogen against thermal radiation, and at the same time reduce landed mass.
NASA/JPL (and Mark Adler that provided you an answer here as its project manager) are currently developing LDSD (Low-Density Supersonic Decelerator) that could decelerate more mass down to transonic speeds with the supersonic parachutes and the SIAD (Supersonic Inflatable Aerodynamic Decelerator) parts without spending any additional propellants for that part of Entry, Descent and Landing (EDL), but that isn't yet at sufficient technology readiness level and the supersonic parachute development has hit a snag now two times during testing and has yet to demonstrate a successful deployment.
Retropulsive landing techniques are also being developed to some extent; NASA's budget is tiny for that at this moment, so it's mostly student work on the dirt cheap Project Morpheus that is pushing the VTVL envelope with technologies such as Autonomous Landing Hazard Avoidance Technology (ALHAT), and of course SpaceX is making big strides towards landing whole rocket stages propulsively, and a big part of what they're now doing on Earth is exactly what's needed to land a rocket stage on Mars, too (and NASA is extremely interested in not just because they're one of their launch providers).
Of course, we'll also need either bigger rockets, or many of the ones we have now and practice once again orbital assembly, to even send that much mass towards Mars first.
So, to wrap things up, there's a lot of technology that still needs to be developed and brought to required technology readiness level, so we're even confident that this is feasible from a technical standpoint. And that doesn't even address political and financial aspects of it (see Mark Adler's answer). But it would most certainly be a welcome learning step before we send sample bringing astronauts to Mars and back, if we could put much of the technology needed to do that first to the test on a robotic mission. Though, maybe we'll opt for a different path, and establish presence on the two satellites of Mars, Phobos and Deimos, use them as a staging ground and learn to produce propellants there. Who knows? We have a long way to go.
Money. Commitment. Confidence. Insufficient amounts of those three are why we haven't yet returned samples from Mars.
There is certainly motivation. The last planetary science decadal survey, Visions and Voyages, where the science community gets together and decides on priorities, rated as its number one flagship mission priority the first of three missions to accomplish Mars Sample Return, where that mission is now referred to as Mars 2020. It has the job of carefully selecting and collecting rock cores and other samples of the Martian surface over about three years, for eventual return to Earth later in the decade. ("Return" is probably the wrong word here — unless we picked the wrong samples, they certainly didn't come from Earth — but anyway "return" is the word everyone uses after "Mars sample".)
Even if NASA commits to the Mars 2020 mission (which could be in the near future), NASA will not be committing at that time to the two subsequent missions that would be needed to transport the collected samples to Earth. The Mars 2020 mission was conceived to have a very robust and novel in situ investigation capability that would justify the mission even if the samples are never picked up.
If the subsequent missions go forward, one of them would be a lander with a fetch rover to go get the retrieved samples and a Mars ascent vehicle (a rocket) to launch the fetched samples into a low Mars orbit. The other mission would be a Mars orbiter that rendezvous with and captures the orbiting sample container and then departs Mars orbit, returns to Earth (there "return" works), and as currently conceived send the samples down to the surface of the Earth in a small entry vehicle. Each of those missions are of the flagship class, which would dominate the planetary science budget for a decade or more.
The cost in the context of NASA's planetary budget is daunting. Furthermore the ability to estimate the cost of such an endeavor in the face of all of the significant technical challenges is limited. There is justified concern over the magnitude of the cost risk, even if initially the cost is considered to be palatable. That is where the deficit in confidence comes in. Not so much about a lack of confidence in it working — we always have to accept some risk there, and we know how to mitigate it — but rather a lack of confidence in our ability to limit budget and schedule overruns to a reasonable level for such an unprecedented technical undertaking. (See the James Webb Space Telescope.)
International partnerships could mitigate the cost, but two attempts at that around the late 1990's and late 2000's both were eventually abandoned. Maybe we're due to try to kick that football again.
The cost and the cost risk, plus the very long time scale of investments over more than a decade with limited payoff unless and until it is successful at the very end of the campaign (longer than any administration), has led to a lack of commitment to Mars Sample Return in the leadership of the US government, including the White House and the Office of Management and Budget.
It would be the dominant fraction of the total planetary budget over more than a decade, where even that fraction might not be enough, so it is difficult for a government that works on year-by-year funding uncertainty to commit to something like that where the payoff doesn't come until the end. Still there is hope that this might get pulled off someday, one mission at a time. Once we have samples on the surface ready to be picked up, we have more motivation ahead of us and more cost behind us.
As for the technology, there is time to develop what's needed even if there were a commitment today to develop and launch all three missions in a serial fashion, picking up on the next mission as the funding wedge on the previous one starts to drop. Nothing about the mission is insurmountable. The greatest challenges are in the area of planetary protection, which impact every phase of the mission from sample collection to Earth entry. Some of those planetary protection challenges are being tackled by the Mars 2020 mission already, as is the significant challenge of collecting intact rock cores. The orbital rendezvous and capture and the Mars ascent vehicle are engineering challenges, not new technology. Overall, there is a ton of work to do, but there are no apparent showstoppers so long as there is flexibility in requirements. This can happen, but only if there is a serious commitment and money to go along with it.