Democracy - it is all about expedient collective decision making. Ideally "we" would discuss things, come to some common agreement, have different options for different people, have various voluntary and free flowing groups that form and dissolve to address needs and wants. But who has the time for all of this? What about dealing with the chumps who never listen and don't think, and therefor will never come to an understanding with others, or who are actively coercive? How about groups of such people?
It seems the simplest way of dealing with this in a good enough way is democracy - we make binary group decisions, based on some proxies who "we" select to make decisions. The most important decisions are protected in a constitution, which is very difficult to change, and then there is a spectrum of increasingly easy to institute decisions - from super majority, down to bare majority. The outcome isn't perfect, but possibly the most effective approach - democracies are on the whole very rich nations, with people who are relatively free, and that are fairly stable from dissolution due to external/internal violence. i.e. democracies seem to be a decent way of dealing with the intrinsic social aspects of people, and that take a handful of fundamental facts about people into account: time is of the essence (we don't live forever) so decisions must be "good enough" (our wealth and relative freedom is a measure that decisions in democracies are, in fact, good enough), humans are violent (anarchy is a nice limiting condition  to consider but, given violence is intrinsic and basic evolutionary ideas, dealing with violence is the first and most important order of business), and specialization is key in modern societies (this relates to "good enough" decisions ).
So what is done? People vote for proxies: typically based on personality, party, ideology, looks, whim, chances of success, feeling good, social pressure, to prevent worse options, etc. Essentially a huge complex bag of reasons. After voting the votes are counted, some rule is applied, and out come our fearless leaders.
Those professional decision makers then try to write and pass various rules for society to live by - mostly dealing with who pays, how much they pay, and who gets the collected cash. Predictably many problems arise - for one they will tend to listen to organized voting blocks (rewarding with direct money, less taxes, or favorable rules). But putting that to the side, how do they operate? How to we predict action and hold politicians accountable?
A key aspect of politicians is their party. The party is the group that the politician works within, and thus gives structure to their actions. The party will have some platform that lays out the nature of this structure, i.e. bounds on the political actor, which includes some ideological aspects (i.e. their vision of long term utopia) as well as various specific "planks" that the party wishes to focus on and implement in the short term. Post election we have a group of various proxies, bound by parties, which then propose and vote on various specific decisions. Parties often will "whip" their members into taking specific decisions, so the party will vote as one. If the ruling party doesn't have enough votes to force decisions they will negotiate with others to come to a common ground and move decisions forward.
Okay, enough of a setup. Here is the question to consider: in a minority situation (the nominal leading party cannot force decisions) does it matter if, post election, various parties form a coalition in order to become a majority and lead? Is this any different then what will happen anyways - since decisions must be negotiated and moved forward, does it matter if all the negotiation happens up front and then specific decisions made versus a one by one negotiation and decisions?
I believe the answer is "yes" - it makes a large difference, others believe "no" - effectively nothing is different. To clarify language coalitions are NOT the common even-based coalitions that are required in minority (or free vote, the ultimate in minority) situations but are instead are campaign coalitions - essentially a new party that is set up, either for a given timeframe, or for good.
In this first take I will only address one issue: what people voted for.
To be legitimate, a proxy should be the proxy that one selected. When picking your proxy you look at many things. For example, I may vote for the NDP knowing full well that they will never lead the country - judging that if in power they would do enormous financial damage to the country, but believing that they will constrain my expectation that the Conservatives will be in power. What happens then if the NDP & Liberals form a coalition? Perhaps not much - after all the NDP & Liberals are somewhat similar in nature . How about if the Liberals and Conservatives joined together - what then? This happened in the outbacks of Saskatchewan . Since what I decided to vote for is changed ex post, is this legitimate? For some people they will have no problem, but for some they will see a huge problem - their entire reason for selecting someone will no longer be true: in business this is called fraud.
This reason alone, ex post change of a party, seems to make things illegitimate - yes, everything changes ex post anyways: depending on the specific makeup of government the path taken may change significantly, but if an ultimate reason for voting is broken, even for one voter, is this not fraud?
Democracy is all about expediency, which is a hard thing to make clean cut ethical arguments about, and some will say - yeah, whatever: the effects will not be very different, and we have to move forward. Coalitions are expedient. Move on, suck it up, live with it, not a big deal.
I sense there will be a large difference in outcome, but must think further. But in terms of fundamental choice - the ultimate reasons people chose their proxies change under a coalition, for some people there will be a big difference. If democracy is effective in part due to its ability to make people feel okay about decisions this is important, quite important: to the extent that people are embittered and divided and feel illegitimacy  there will be "negative externalities". We simply do not know how large this is, if there are thresholds, if this is a positive feedback problem, etc. Given how terrible most of the world is, do we really want to do an uncontrolled experiment here?
I am against ex post formation of parties, as I feel that this changes things, and as this will definitely make some feel "ripped off" and color the system as fraudulent in their eyes. In terms of perception there will be negative, and likely inestimably, effects; in terms of actual legislative effects - that is an argument for another day....
One final note here: the question is not whether this is "legal" or not, but if it is legitimate. Slavery was once legal. Force feeding acid to animals to make MSDS sheets is both legal and mandated (even though we get no useful information here... anyone can predict the effects, and anyone who "uses" an MSDS knows how useless they are - they are effectively a buracratic neccessity). In terms of legistlation this may be legal, if only because this falls outside the rule set and the precedents are allowed to stay, in terms of common law it is questionable, in terms of what is just - that is the whole point of discussion here....
 I tend to favor "proxy anarchy" - democracy where all decisions made by politicians are "free votes", i.e. parties cannot force members to vote in a certain manner. In Canada we do not have this system, with parties setting a common line and forcing their members to vote as such. In the US I believe the system is closer to free votes in congress - and as the US is much more socialist  than Canada one can see that perhaps my preference does not work in practice.
 This is the reverse as normally claimed - but considering that in practice there is little difference between the US & Canada, that the official tax rates are basically the same, and that the US has a further tax component that is debt funded (i.e. a tax on even unborn people - or spending peoples money that are not even alive yet, if socialism is spending other peoples money this is the ultimate in socialism!), i.e the US effectively taxes at a higher rate than "socialist" Canada, it seems that the US is more socialist. Of course there is nothing wrong with socialism, I'm using the term to describe negative socialism - the misuse of other peoples money.
 This is the perception at least, it appears to me that the Liberals and Conservatives are actually more similar, but since people tend to call them "Left" and "Right" people think they are vastly different. Perhaps better to call them "middle + delta_minus" and "middle + delta_plus", and call the NDP "middle_if_ the_world_was_still_in_a_time_that_communism_was_intellectually_viable").
 My previous footnote may seem to undercut this - but now we have two aspects, 1) the perception of small differences joining, but in fact somewhat large, versus 2) the perception of large differences joining, but actually not that difference. Some votes will perceive no problem, but some will perceive a problem, for both of these situations. Going back to the NDP/Liberal/Conservative split - of course things are not very clean cut, it is like paper-rock-scissors, there is not clean ordering of who is closer/further, so this confuses the issue further. Some people may be OK with a NDP/Liberal coalition, some with a Literal/Conservative one, because what they care about is common. Others will have the opposite preference. Others would hate either. It depends on the voter.
 Some would claim we are already there, with many people not voting. Of course the opposite conclusion is also possible - if one didn't vote one is okay with the status quo. After all, if one really thought the current situation was horrid it would be more reasonable to walk over and spoil your ballot (as long as this is an option; which I think is an important one to keep). If everyone who hates the system wrote "destroy the system" on their ballot everyone would know deep changes are required.