The observation has no scientific importance, but Mark Lemmon of the team controlling Curiosity's mast camera said, "This is a nod to the relevance of planetary transits to the history of astronomy on Earth. Observations of Venus transits were used to measure the size of the solar system, and Mercury transits were used to measure the size of the sun." The transit occurred on June 3, but NASA released the footage a week later.
An attempt to measure the start and end Transit of Venus in 1769 brought Captain Cook to the South Pacific, eventually resulting in the mapping of the east coast of Australia. For Curiosity, the chance to observe a transit had nothing to do with its positioning on Mars, let alone its timing, but the decision to turn the camera sunwards could still be seen as an acknowledgement of the history of exploration.
If all the planets' orbits lay in a perfect plain transits would happen every time an inner planet overtook an outer one on their journeys around the sun. However, slight inclinations between the orbits mean that transits only occur when planets are at just the right point. For example, transits of Venus from Earth can currently only occur in early June or December as these are the points where the planes of the two planets' orbits cross.
Although Mars naturally has more opportunities for transits, with three planets between it and the sun, none of the previous landers or rovers observed one. Transits on Mare are less impressive than from Earth, by virtue of the transiting planets being further away. In NASA's video (see below) Mercury is overshadowed by two large sunspots, thanks to solar activity being high at the moment.
The Earth will get its own transit of Mercury on May 9 2016, visible from North and South America and western Europe. Mars however, will have one even sooner, in April next year.
In November 2084 Mars will experience a transit of Earth, which might prove truly exciting to homesick colonists.
Meanwhile Curiosity has collected powder from drilling a sandstone rock called Windjana and is heading towards nearby Mount Sharp while its onboard instruments analyze the cuttings.