Shanks is evil.
He wants one piece for himself, but knows only the D's can claim it. That's why he was worried about Teach and Ace clashing, because he could lose a D that way.
BB figured out his plan earlier and gave him the scar as an answer.
Shanks then went to Luffy, and gave up his arm for him willingly to prompt up a reaction from him, and make Luffy feel as if he owes something to him.
Notice how we do not see his eyes, but only a smile, and an ominous one as well.
That way he can use Luffy. He knows time is approaching.
Peep that badass look and vibe he is giving off, a tad bit ominous as well.
After figuring out that Ace was similar to his captain, and that he wanted to make WB the king, Shanks gave up on him.
Shanks even went so far as to prevent Kaido from reaching WB, his former crew mate. Kaido probably wanted to help him.