I have never seen the sequel or read the sequel to the book, and I'd imagine they address it further there, but we should be able to get a sufficient answer from the film alone. In the voiceover at the end, Renton says
Now, I've justified this to myself in all sorts of ways: it wasn't a big deal, just a minor betrayal, or we'd outgrown each other, you know, that sort of thing, but let's face it, I ripped them off. My so-called mates. But Begbie, I couldn't give a shit about him, and Sick Boy, well, he'd have done the same to me if only he'd thought of it first, and Spud, well, OK, I felt sorry for Spud -- he never hurt anybody.
So why did I do it? I could offer a million answers, all false. The truth is that I'm a bad person, but that's going to change, I'm going to change. This is the last of this sort of thing.
In the scene beforehand at the bar, Sick Boy admits that he would have taken the money and run if he'd been left alone with it like he'd just left Renton and Spud. Renton also says that the money would last much longer than the feeling of connection with his friends:
We settled on sixteen thousand pounds. He had a lot more in the suitcase, but it was better than nothing. And just for a moment it felt really great, like we were all in it together, like friends, like it meant something. A moment like that, it can touch you deep inside, but it doesn't last long, not like sixteen thousand pounds.
Overall, the main idea is that Renton has undergone sufficient growth to recognize his bad behaviors and wants to move on to a normal life, and doesn't believe he can do that without enough money to escape and without separating from his friends. We see his withdrawal demonstrating him coming to terms with who he was, followed by him staying clean, separating from his friends, and getting a new job. The resurgence of Begbie and Sick Boy in his life leads to him losing his job while trying to get distance from them. His lack of connection to them is further demonstrated by his disgust that they are planning a drug deal immediately after Tommy's funeral, and that they are requesting his money, leading him to use heroin again, and that they are endangered by Begbie in his fight after the deal. He's ready to escape fully from the lifestyle that he feels is inevitable by being with them.