Personally, my read on Shanks is that he's trying to stop ANYONE from becoming the Pirate King, because he's trying to stop a war from breaking out.
Here's the thing. I think Shanks knows what the One Piece is. I think Roger told him, back when he was a kid. And the thing is, while all the Roger Pirates laughed, Shanks cried. Unlike every other Pirate we know, Shanks cried after finding out what was on Laugh Tale. Shanks sees things differently than the Roger Pirates. He doesn't think the same way they did. He probably sees things very differently than Roger or Luffy. And this did seem to change Shanks' entire life plans, as we saw with the fallout between Shanks and Buggy. Shanks decided to change what he was planning on doing with his entire life after Roger told him whatever it was after they got back from Laugh Tale.
And, as far as I remember, I don't think Shanks has ever said that he wants to be the Pirate King. He did say he wanted to "claim" or "plunder", the One Piece, depending on the translation. But, I don't think he's ever said anything about wanting to be the Pirate King. I think that's important.
And we've seen that Shanks likes to protect weaker people. His entire wider fleet is made up of weaklings that Shanks let join so that he could protect them. So, I think that tells us a little about his personal philosophy. And I think we can extrapolate what he has planned on a larger scale from this idea. But, we've also seen what happens when someone tries to bully the people under his protection, like with Bartomoleo and Kid. He's pretty merciless to those who try to do anything to those under his protection.
So, I think that Shanks is trying to put Laugh Tale, the physical location, under the protection of his territory so he can be sure that NO ONE can step foot on the island. Not the World Government. Not Imu. And not even Luffy. Because, he knows that if anyone tries to use the One Piece, it'll upset the balance of the world. It'll most likely start a war just trying to get close to the treasure. And a war like that will get a lot of innocent people caught in the crossfire who can't defend themselves.
He's trying to prevent a war that would get a lot of weaker, innocent people hurt. He's trying to stop anyone from doing anything stupid. Both the World Government. And even Luffy, which will likely be much harder. That might explain why he was willing to talk to the Gorosei (if that was him and not his "secret twin").
Shanks might even know that this is all "destined" to happen. That history is repeating itself. Maybe the reason why Shanks has such strong Haki is because he has the determination to try and change "fate" itself? A lot like with Zoro trying to "conquer" death, I think Shanks is trying to "conquer" destiny and the repeating cycle of history. The strength of your Conqueror's Haki seems to be partially tied to what it is that you're trying to "conquer" or overcome. So, I think if Shanks has such strong Haki, he must have a "opponent" that's more powerful than any we've seen before. So, I think Shanks' ultimate goal is to try and prevent another Void Century Incident from happening again.
So, why would Shanks let Luffy have the Nika Fruit? Simple. Because he was a child at the time. He wasn't a threat. A child having the Nika Fruit, instead of a adult who would have likely abused the power, bought Shanks the time he needed to build up his power and territories. At least he knows who has it now. And Shanks can probably find Luffy, if he needs to.
Even Luffy going around beating up other pirates and causing chaos in other countries, doesn't really effect Shanks' actual long-term plans. If anything, it might actually help Shanks in the long term. It gets rid of anyone else who might have risen up the Pirate ranks and challenged Shanks himself. Defeating ONE powerful enemy is still easier than trying to defeat a DOZEN strong enemies coming at you from all sides. If Luffy defeats every other powerful Pirate crew out there, then that means there's less people who could possibly try to attack Shanks.
It's possible that Shanks believes that he can eventually get Luffy to basically join his side in all this. I think Shanks thinks he can convince Luffy to join up with him to help defend Laugh Tale from everyone else trying to get there and use the power. That way, Shanks would now have TWO fleets capable of defending the island. And having the guy with the Nika Fruit would give him more bargaining power with the World Government.
So, personally, I think Shanks is going to give Luffy a ultimatum whenever they meet again. Luffy has to either join Shank's Fleet....or they have to fight. He can't let someone else have that power. And if Luffy won't join him, he's going to take the Fruit back from him, just like he'll take the Strawhat away from him. And I think Shanks believes Luffy WILL join him, because he thinks Luffy is like he used to be. I think Shanks believes that once he explains the situation to Luffy, he'll have a similar reaction to how Shanks reacted when Roger told Shanks about the One Piece. I think Luffy reminds Shanks of himself as a child, so he believes Luffy will react the same way he did, when he found out the truth of the One Piece. He thinks Luffy will cry instead of laugh when he finds out what the One Piece is. Of course...that'll never happen. That's going to be a miscalculation on Shanks' part.
Or...maybe Shanks actually was serious about Bartolomeo poisoning Luffy? And maybe that "poison" wasn't the type of poison we thought it could have been? Maybe it wasn't poison for the body, but the Devil Fruit INSIDE the body? More on that here:
https://worstgen.alwaysdata.net/for...the-devil-fruit-cure-and-imu-the-fairy.60827/
So, basically, I think Shanks is trying to keep the powder keg that is the World and it's politics from exploding and killing everyone. I think Shanks is trying to keep the peace, and trying to stop a large scale war from breaking out, which could hurt a lot of civilians who have no way to defend themselves. Basically, he's trying to keep the status quo. He doesn't want to upset the apple cart, and risk starting something that will end with people losing their lives.
So, I don't think Shanks is evil. I just think Shanks just has a completely different goal than anyone else in this story. And he's probably willing to do anything he needs to in order to fulfill that goal. And chances are that goal will cause him to come in conflict with Luffy. This is a shonen battle manga, after all. It's just WAY too tempting to have your protagonist and "mentor" fight each other.