Is my potential phd supervisor ethical?
Here is another perspective: a professor offered you substantial help with your application and you end up complaining that they wasted your time. Trying to figure out whether you’d be a good fit, they discussed research with you  at length and help you draft a research proposal (which you hopefully use to improve your acceptance chances in other applications). After several days (or weeks) of discussion they decided that you’re ultimately not a good fit.
There can be a million reasons: another student was a better fit, funding was denied, research needs changed and so on. Rejection sucks, and I do sympathize, but it sounds like the professor went waaaaay out of their way to help a stranger; their reward? Getting trashed online for it.
Your lesson from this should be to not place all your chips on one advisor so to speak. When I interview candidates I implicitly assume they’ve applied to at least 10 other places and discussed their work with others. I had prospective students and research fellows rescind my offers after I had invested a ton of time and effort into getting them admitted. It sucks, but that’s life.
Edit: seeing the discussion in the comments regarding foul play, I don’t think that’s likely. While there might be a chance of that, think about it - why would anyone not want to hire someone who has great ideas? I don’t see the causal relation here. Coming into research with a non-cooperative mindset won’t help you in the future.