[I apologize in advance for the tone of exasperation that comes into what I write below when the question suddenly shifts from appearing to ask for advice about what test to do to revealing that you already tested the hypothesis. I'll leave it as is, but be prepared for that.]
I want to compare two data samples which come from continuous distributions.
This is too vague a statement to start choosing a test from. You need to more clearly express what the research question is/what you need to find out/what you're doing this for.
However, the data is highly skewed and t-test is obviously not a choice.
It seems like the responses for the two groups are strictly non-negative quantities.
What are the data measuring? What values are possible and impossible for the variable?
Why did you consider a t-test in the first place? Your initial sentence (you simply expressed a wish to compare two distributions) gives no hint that a t-test would be a suitable choice; it's specifically about comparing means under a set of conditions.
As an alternative, I wanted to use the MWW test for locational shift, but one of the assumptions is that the distributions of the groups should be similar, but in my case one group has a much longer tail than the other.
A location shift alternative usually doesn't make sense with a non-negative variable. I'd say more if I knew more about the variable, but you should probably consider whether a different sort of alternative makes sense (e.g. a scale-shift alternative often makes sense in such cases).
If you considered a t-test, you were apparently interested in comparing means; that's still possible with a scale-shift, given any of a large class of suitable models (or can be done nonparametrically).
If you don't insist on restricting yourself to a location-shift alternative, the WMW would be fine as long as it corresponds to your alternative of interest.
My last choice was the KS test used to compare arbitrary distributions.
Given your earlier statement that you sought a location shift alternative, that makes no sense -- you definitely would not be getting a pure location-shift alternative with this test (it rejects other things as well). If you want a "tends to be bigger" alternative, WMW would do that. If you want a scale shift alternative (which I expect will make a lot of sense once you explain what you're measuring), then you could easily go back to a comparison of means.
However, after running the test,
Then it seems you're done in any case, there's nothing more to be done now.
If you did a test already, you don't get to backpedal and choose a different test because the one you did was not powerful enough to reject. To choose to do another test in that circumstance would seem to be p hacking.
What troubles me is that I argued not to use MWW because the distributions differ,
Your problem was insisting on a location shift alternative (which is the only reason you'd need them to be the same shape under the alternative), an added requirement (above what the WMW needs) that you were nonetheless happy to abandon when moving to the KS test instead.
This inconsistency (not using WMW because it didn't appear to satisfy a condition you immediately abandoned anyway) seems strange to say the least.
Can somebody explain if my reasoning is valid, or is there something I forgot to consider?
When looking to do a test (assuming a test actually answers the question of interest):
First figure out what sort of alternatives (a) make sense to consider given your variable, and (b) that would be of interest.
(Why insist on a location shift alternative? Why then abandon it so readily?)
Then choose a suitable distributional model (or choose to avoid any specific distributional model). On that basis, choose a suitable test.
Don't use more than one test.
Additional comment: As a general rule, using the specific data set (e.g. via your boxplot) to inform your test choice may be problematic, as choosing the specific hypothesis on the basis of the exact same sample values you want to test it on impacts the properties of the test. If you can inform yourself about how the variable should behave (at least under H0) without having to do that, so much the better.