Friendship and likeability are not the only grounds on which people include others in a group activity.
Maybe it has to do with what other people seek when they plan an activity. If you are planning a cook-out you may want someone who enjoys cooking. So on with travelling, learning and so forth. Sometimes people are selected for their lack of expertise, because the group does not want advice, only participation. The important thing when you are left out, is to remember that nothing is wrong with you specifically or generally. It has to do with what other people want. And you cannot be everything to everyone at all times, so yes, you will be left out. You can also solve this problem, by starting an activity and inviting people to it that would enjoy it. Then you can have a good time and don’t worry about the activity where you were left out.