One reason to raise a caterpillar might be to enjoy watching the butterfly life cycle close-up. The first time a butterfly emerges from it's chrysalis right in front of you it's amazing! The second time is just as fabulous...
Another reason might be the parasites and bacteria in your garden. Raising caterpillars inside helps protect them from some of the more unfortunate endings that outdoor caterpillars are subject to.
My best reason is that it's the only way to get a good look at (and thus photograph) some butterflies. For example: Zebra Heliconian Butterflies flitter about slowly near the ground. They'll land right in front of you, sometimes even on you, and let you have a close up look at them, but Giant Swallowtail Butterflies tend to zip about high overhead, zoom along really fast, and never let you play with them. I raised this Giant Swallowtail from a caterpillar, and you can see that it's posing on my finger while it's wings finish drying. [I was going to say 'happily posing', but butterflies don't have a mouth, thus they can't smile, so it's difficult to say for sure if they're happy, or just waiting for me to go away and leave them alone.]