There's a relatively famous essay "A Mathematician's Lament" that argues in one section that math courses should be largely student-led, since the actual study of math involves solving many problems which you, the mathematician, decide on. I think that would basically be the right idea to get students interested, but the main goal of most math classes below the university level is to equip students to solve simple math problems that might occur in physics (mostly classical mechanics, I guess), and engineering. I don't know that there's a way to get everyone interested in basic calculus to be honest.
Like, you could shift focus in high school or middle school to number theory, graph theory, combinatorics, since these have many more interesting problems that don't require too much background knowledge, but students will still need to graduate knowing how to find extrema of some continuous real-valued functions. Is there a way to make getting kids to memorize how to find the extrema of real functions fun? No, because it's simple, and it's boring, and who cares anyway until you see the same problem a year later in your mechanical engineering course.
I think the best solution I can imagine is to split math education into 'application-centered' and 'theory-centered' courses, but that would take more money and time than is reasonable. Plus, most teachers (in the US and elsewhere) are NOT qualified to teach a beginning real analysis course, a beginning modern algebra course, or any other intro math class like that
Here's a link to the mentioned essay, I would really recommend giving it a brief read:
https://www.maa.org/external_archive/devlin/LockhartsLament.pdf