I sorta liked this episode at the time, even though it wasn't the pinnacle of the series. It's a return to the idea of the ship having families aboard, a la season one but done with Piller-era's refinements and not the usual "incorporeal critter that takes over kid uses kid to murder all the adults, moohahahaha" shtick.
It uses the ol' trope of "twilight zone mystery aliens" combined with the Trek staple of "aliens want to understand why humans do things the way they do". It's a bit on the soft side, yes, but if people want something truly worthy of reputations such as "bland" or "dumb", there are a few from seasons 5-7 that more readily qualify. "Imaginary Friend" isn't perfect and isn't a classic, but it's got a couple decent enough twists.
Back to good reasons - children have imaginary friends that adults either patronize or disregard offhand. One would think that, in Star Trek Land where incorporeal aliens exist very frequently, no adult would wave away something like this - especially by the 24th century where all of Kirk's documented captain logs (along with everyone else's) should have everyone as accustomed to incorporeal energy fritters as any of Pavlov's poochies would yet don't... but is that the reason the episode is so vehemently disliked? Probably not, but it'd have been a stickler for me at some point... but TOS and TNG are replete with examples, of which Troi of all people as she had her body taken over by such a fritter after x number of times she dealt with energy beings in the past. Nope, Clara is just a child and has schizotypal or whatever disorder can be flung at her like a banana cream pie. Unless Troi has her own disorder and she blocks those memo-
The fact it is returning to some of season 1's notions, after doing sequels and bringing back various characters in season 4 because they had nothing new to do, would be more than enough for some. Never mind this is the same season 5 that already reused season 1 effects such as the Edo ship in "Conundrum"... now comes this episode where they're dipping back into season 1 territory with "kids on the ship" after so many adult-themed episodes, of which not all were all that great (or haven't aged well), that alone might have been jarring for some as well...
But facing one certain fact: The only thing missing from this story that would have been easy pickin's for critics would be if Clara were to pull a Wesley and yelling "I'D BE LISTENED TO IF I WAS AN ADULT!!!" and let's be thankful for that... but it would have been fun if she ditched Calculus to play with the imaginary friend in Engineering to be bumping into all sorts of adults who thankfully weren't at battle stations (of which season 5 is mostly devoid of, so that helps...)
And not just after 2 months of adult-themed episodes, aired after the dismal "Hero Worship" no less, that'd have set people off back in the day as well. Not me; I remember liking "Imaginary Friend", but not loving it. But after a handful of dark scripts comes this fairly lighthearted romp...
I'm sure viewers Clara's age liked it, assuming the parents let them watch after episodes such as test tube babies vs coitus arguments, physical assault, an charismatic fun guy stealing items from around the ship, and other kid-not-friendly-at-all things and all... That, and I still loathed "Hero Worship"'s lame and barrel-scrapin' inanity. Still do, it's one of season 5's weakest. But that's another story...
Did kids like this episode at the time? Or by this time were kids too busy getting Mario to hook up with Princess Peach in Sonic's castle instead?