I don't know about illegal, but the government comprised of 2nd and 3rd place parties would be highly illegitimate in my eyes and Milliband would be no better than a squatter in number 10 being held up by a party that isn't even a proper UK party. It was be a disaster of Labour and if he would be decimated in the polls come the 2020 election.
I think he knows this, don't be surprised if he steps aside if the Tories can convince the Lib-dems to side with them along with whatever UKIP and the DUP have
So the first place party propped up by the fourth, fifth and the (likely) 8th or 9th place party would be more legitimate than a partnership between 2nd, 3rd and 4th in your eyes? The DUP don't stand in most of the UK either.
First Past The Post, unless inconvenient.