"Epicycles" (Ptolemy style) in math theory? By analogy:
The epicycles of Ptolemy explained the known facts in the sun system and in this sense were not "wrong". But they distracted from a better insight. From another viewpoint, everything fell neatly into place.
Do you have examples from pure math? Again, you have a theory, it's OK in the sense that it gives the answers you want, but it's hopelessly contrieved, and suddenly someone sees the stuff from another viewpoint and everything becomes ridiculously simple? 
It's quite probable a comparable question with other wording has already been asked, a link then would suffice. :-)
(QUICK EDIT as long as it's hot: While I already upped an answer with nice examples, I also would be interested which "current" theories you see as epicyclic and in need of a Kopernikus/Kepler/Newton. Remember, soft question, a lot of esthetics is involved in the judgment.)
 A: Purely mathematically, Ptolemy's geometrical model representing planetary motions in Polar Coordinates is:

$\displaystyle \frac{r}{a}$  $\textstyle =$    $\displaystyle 1 -e\,\cos M + (3/2)\,e^2\,\sin^2 M,$
  $\displaystyle T$    $\textstyle =$    $\displaystyle M + 2\,e\,\sin M + e^2\,\sin 2M.$

where, $r/a$, relative radial distance, $T$ true anomaly, $e$ eccentricity and $M$ mean anomaly. Compared to Kepler's: 

$\displaystyle \frac{r}{a}$  $\textstyle =$    $\displaystyle 1 -e\,\cos M + e^2\,\sin^2 M,$
  $\displaystyle T$    $\textstyle =$    $\displaystyle M + 2\,e\,\sin M + (5/4)\,e^2\,\sin 2M.$
   only deviates to second order in $e$. 

 Ptolemy's model has 5 errors (not in the perjorative sense):1. Ptolemy's first error lies in his model of the sun's apparent motion around the earth.2. Next error was to neglect the non-uniform rotation of the superior planets on their epicycles.3. Third error is associated with his treatment of the inferior planets. 4. Fourth, and possibly largest, error is associated with his treatment of the moon. 5. Ptolemy's fifth error is associated with his treatment of planetary ecliptic latitudes.The final failing in Ptolemy's model of the solar system lies in its scale invariance. Using angular position data alone, Ptolemy was able to determine the ratio of the epicycle radius to that of the deferent for each planet, but was not able to determine the relative sizes of the deferents of different planets. In order to break this scale invariance it is necessary to make an additional assumption--i.e., that the earth orbits the sun. His theory was based on naked-eye observations of the visible planets, there was no way, empirically, to make a better model based on the evidence. 
A: Hamilton's quaternions made physical calculations a good deal easier, but vector calculus and vector algebra have proven to be far superior tools in mathematical physics.
A: *

*On Ptolemy. It is incorrect to say that Ptolemy's description of the motion of the planets with epicycles was "wrong". In the modern times, when we want to compute the positions of Sun, Moon and planets, with respect to Earth (and to do astronomical observations from Earth you need exactly this!) we use long trigonometric series. Mathematically, trigonometric series is the same as epicycles. Some coefficients of these series are obtained by solving differential equations, others are empirical. In Ptolemy, all coefficients were empirical. But the FORM of the description is the same as in Ptolemy. 


Ref.: Jean Meeus, Astronomical algorithms, Willmann-Bell, VA, 1998.


*On mathematical theories which became obsolete because better theories were invented.
An example is "vector calculus" which is still taught to all undergraduates for the reasons that escape me. It is superceded by much simpler formalism of differential forms.
(Poor students still have to memorize the complicated expression in Stokes' theorem in the
Stokes original formulation!)


Many proofs with elementary geometry methods are replaced nowadays with analytic geometry
and calculus. Remember, Newton wrote his Principia without explicit use of calculus. No one uses his obsolete arguments in this form anymore.
EDIT. To see that epicycle is the same as a trigonometric series, use complex numbers.
The uniform motion of a point about the center is $Ae^{i\omega_1t}$. In the case of one epicycle, we have a deferent and epicycle; the motion has the form is expressed in the form $Ae^{i\omega_1t}+Be^{i\omega_2t}$,
the center of the epicycle is $Ae^{i\omega_1t}$, it is moving with uniform speed on the deferent. The planet moves around this point with angular speed $\omega_2$.
By the way, in this notation the famous theorem of Apollonius "on the equivalence of excentric and epicycle description" says exactly that the addition of complex numbers is commutative:-)
In more complicated models, more than two terms is required. In the modern theory of the Moon, we have several hundred such summands. The summands other than the first one are traditionally called "inequalities". The first two are due to Ptolemy. The third and fourth to Brahe, and so on. You can see the whole series in the book by Meeus cited above.
EDIT2. Undergraduate textbooks using differential forms:
P.Bamberg, S.Sternberg, A course in mathematics for students of physics, 2 volumes, Cambridge University Press, Cambridge, 1991. (Used to be the standard text for science students in Harvard)
H. Cartan, Formes différentielles. Applications élémentaires au calcul des variations et à la théorie des courbes et des surfaces, Hermann, Paris 1967 (This is the second part. First part is called Calcul diffenentielle).
G. Grauert, I. Lieb, V. Fisher, Differential- und Integralrechnung, 3 volumes. Springer 1967-1968.
All these are general, complete calculus textbooks. I am not mentioning textbooks which contain differential forms only, like Spivak and Flanders. 
A: Euler found values of the Riemann zeta-function by artful manipulations of divergent series, e.g., interpreting a function that's $(-1)^{n/2}$ at even $n > 0$ and $0$ at odd $n > 0$ as $\cos(\pi n/2)$. The calculations were later justified by analytic continuation of the zeta-function from the right half-plane ${\rm Re}(s) > 1$ to the whole complex plane. This led him to discover the functional equation of the zeta-function over 100 years before there was a suitable language for it to be properly expressed.  None of this is done by divergent series anymore (except as heuristic explanations on YouTube to show why $1 + 2 + 3 + \cdots = -1/12$).
Early proofs of the quadratic reciprocity law are like epicycles. The first proof by Gauss was a horrible induction. It verifies the theorem, but in a very opaque way. While Tate later used ideas from that proof when he was computing a $K$-group, it's fair to say the proof by Gauss was really ugly. Much slicker proofs were found later, including by Gauss himself. For that matter, Gauss composition of quadratic forms was a very difficult topic until it later got reinterpreted as multiplication in a (narrow) ideal class group.
The way Galois constructed general finite fields (of non-prime size) could be considered epicyclish, in the sense that he created new "symbols" subject to algebraic rules, but there was no clear definition of what these symbols were. Much later his construction could be treated as an instance of quotient rings: $\mathbf F_p[x]/(\pi(x))$ for an irreducible $\pi(x)$ instead of $\mathbf F_p(\alpha)$ where $\alpha$ is a "symbol" subject to the rule $\pi(\alpha) = 0$. The advantage of the latter language is that it removes any doubt about the legitimacy of calculations made with these formal symbols.
Kummer's creation of ideal theory was pretty obscure to his contemporaries.  He built what he called "ideal prime numbers" for cyclotomic fields essentially by defining what today we'd call the discrete valuations associated to the (nonzero) prime ideals of the ring of integers in those fields, but without being able to say what the prime ideals themselves were. Later Dedekind came along and defined ideals as actual subsets of the ring of integers of a number field, showed how to multiply them to get unique prime ideal factorization, and Kummer's "ideal numbers" largely vanished into history.
Some aspects of the development of algebraic geometry fall into this category as well, comparing the era when Weil's "Foundations of Algebraic Geometry" was the dominant language with Grothendieck's language of schemes that replaced it. Kedlaya's notes http://ocw.mit.edu/courses/mathematics/18-726-algebraic-geometry-spring-2009/lecture-notes/MIT18_726s09_lec01_intro.pdf even mention the analogy Weil's Foundations <-> epicycles and schemes <-> Galileo and Kepler. 
