For most Japanese people, opportunities to meet foreigners are not very common, and opportunities to talk to a foreigner who speaks Japanese are even rarer. As a result, many Japanese have a preconceived notion that "This foreigner will not speak Japanese." In other words, we estimate the Japanese level of people who look non-Japanese to be almost zero every time.
Nowadays, many foreigners who try to talk to Japanese people now have a greater or lesser knowledge of Japanese, and can speak a simple greeting and "すみません、ちょっとお聞きしたいのですが (Excuse me, I'd like to ask you a question.)" This easily surpasses our preconceived notions and expectations and brings surprise, joy, and relief.
How do we treat people who have gone above and beyond our expectations? Naturally, we will try to respond with gratitude and praise. So, regardless of the level of Japanese, we will praise the foreigner's Japanese every time.
I don't know much about that meme. And I've heard the loneliness of naturalized Westerners treated as "gaijin" forever because of their appearance, despite having lived in Japan for more than a few decades and speaking native-level Japanese. But for most Japanese people, there is no underlying meaning. It's just simple pure goodwill.
I don't see any difference with that foreigners say "You speak English(or other languages) very well" to Japanese.Most people know that doesn't always mean you speak like a native.It's just a compliment most of the time.It's just that some people misunderstand.
After writing my opinion before, I thought that there are cases where you say "Thank you" and are said "You're good at Japanese," so I thought about it again. And I think it would be ok to take it as "I like your Japanese." Some people may be praising your language ability, or they are having a good impression of your attitude toward Japan.