I'm from Israel, and while I don't personally abide by any religious rules, I do come into contact with people who do and have an idea: it is important to understand that most people do not follow these rules as a functional method to achieve some goal. For example, it's not like they're actively thinking "oh if I press this button on Sabbath then I'll go to hell, and I wanna go to heaven so I won't".
Instead, they're following these rules as a social decree. In their circles, it is the obvious and accepted thing to do to follow these rules, which the community's leading Rabbi sets (or well, gives guidelines which are socially considered binding). If you don't follow the rules, then you're a weird one, and religious communities tend not to be accepting of the different, so they will shun you for turning on the light on Sabbath (if you keep doing it..)
So for one born into a religious community, you're taught to do so and there is a strong social incentive to do so: if you don't, you're first branded an odd one, and in some cases shunned, depending on how severe your straying off the path is. If you were told that were you to use the elevator normally, your parents would be very upset with you and may stop talking to you altogether, you'd think about it twice, even if you don't personally feel that you want to follow Judaism.
Finally, the religious authorities have a power incentive to do this: by setting rules and maintaining their position as the authorities who set rules, they keep a lot of power over a large number of people. Often this even manifests financially, as a respected religious authority can give Kosher certificates (and many products which are not food, like phones, can also be Kosher) - of course, the certification costs money, just like a SOC2 audit. Same goes for Sabbath certified electric devices - someone gave their stamp of approval, and the developer paid for it.
So to summarize - religious authorities enjoy power and money by being those who set the rules, everyday people have a strong social incentive to follow the rules as breaking them is taboo.
I think about it like following requirements set by certain certifications. Not all requirements make sense in every context - sometimes you may feel silly complying, knowing you're doing it just to check a box, even though there's no practical value to it.
But there is a value to passing the audit and getting the certificate saying you comply from EY or whoever, so you abide by the requirements, even when they don't make sense, so you can show your ~Kosher~ ISO certificate when you need to.
I'd like to point out that this isn't all there is to it - there are very obviously other incentives to do things this way (e.g. personal belief), but I'm just trying to make an analogy with terms from the HNer's day to day to show why you might follow religious rules even if you're (say) a teenager who doesn't care one bit.