Both of these city-states have been studied as examples of how to (or not to) maintain a republic. From Machiavelli to Thomas Jefferson, numerous political thinkers have commented on both city-states. Generally speaking, republican theorists have associated Sparta with the austere patriotism (known as virtue to many republican thinkers) that enabled them to maintain power for as long as they did. Machiavelli, in particular, held Lycurgus, the legendary king of Sparta, up as a great law-giver, and thought that Sparta's decline was due to its deviation from his laws. Samuel Adams famously said that he had hoped Boston would become, as a result of its sacrifices in the crisis leading up to the American Revolution, a "Christian Sparta."
The legacy of Athens is a bit more complex. On the one hand, thinkers like Montesquieu have been interested in portraying Athens as a republic that declined because it deviated from its original purpose. Montesquieu, for example, blamed this for the fall of Athens to Philip of Macedon. However, Athens had perhaps more often been remembered (including by Montesquieu) as an example of a western-style democracy, devoted to personal freedom and intellectual and cultural development. This is expressed, for example, in Raphael's famous painting The School of Athens, which depicts many of the great classical philosophers and scientists in that city.