Technological advances have made 2D animation cheaper, and if you look at Disney's budgets over time you can see that they started climbing in the 90s when 3D animation started being used, and once the movies went full 3D the budgets increased even more. But apparently 3D movies make so much more money that the extra cost is worth it.
The level of 2D animation in television was always poor to mediocre, and almost everything started being outsourced away to Asia in the 80s.
Asking why 3D didn't replace 2D in Japan is kind of like taking for granted that 3D replaces 2D, but from what I've been able to gather it happened in America because of the following (possible) reasons: 1. Toy Story and Shrek were big hits and something new, 2. a lot of low quality 2D movies came out, 3. 2D didn't make as much money as 3D, 4. the more flexible nature of making 3D animation may have been attractive to the suits, 5. Disney was already using so much 3D that they thought they may as well go all the way, 6. 2D animation was stale and stuck in a rut, and increasing doses of 3D animation were needed to proceed forward, 7. even video games in America dropped hand-drawn graphics and 2D gameplay in favor of 3D as soon as they could, suggesting that there's some general orientation towards 3D.
In anime, 3D didn't offer much that was new. It didn't expand anime to new audiences or introduce new types of storytelling or enable many things that weren't already possible with 2D techniques (that are still in use today). They have a very large and well-developed 2D industry that has great synergy with other forms of 2D media like manga, and the industry is so interconnected and reliant on freelancers and outside companies that it's a lot easier to work with 2D animation. The Japanese also prefer the aesthetic of 2D over 3D, 3D is more expensive too.