I think it's ok to have motives other than health for it. Like everything else, people can have the same goals but different motivations. Two people might enter an art competition- but one is motivated by the big money prize, the other is motivated by sharing their art with others. And both those people might flit between being motivated by the others reason from time to time too. Also, being a healthy weight is something you can see- whereas "being healthy" isn't. It's much easier to measure your weight than your health. So naturally, we're more motivated by progress we can easily see than progress which is hard to measure
All you might want to do is try to match up your methods for losing weight with doing it healthily
The body is an incredible thing, whatever size or shape. It's ability to adapt, survive, heal, react is outstanding. Sometimes I like to take a moment in the day and appreciate that. Like the other day, I went for a run and got some painful blisters- very annoying for restarting a running habit! But I took some time to look at them and realise that the fluid in them brings nutrients to the new skin growing underneath and keeps it moist so it doesn't split, the skin over the top keeps it sterile, and the nerves underneath tell me to stop doing what im doing because my toes are too soft and need time to adapt. And it does all this on it's own!!
I dont think you have to change your mindset completely
I think body appreciation- with love and kindness to yourself- while trying to improve your body (whatever that might look like and regardless of your motivations) is a skill that everyone can learn, if they are interested and learn to practice it