I've recently had an experience where I wrote an editorial at the behest of a distant colleague. He was invited to write it by a journal and asked that I do so with him (for him actually). Is it still appropriate for him to be first author even though he did not write any of it (but he was the invited author)?
Authorship practices vary quite a bit from field to field, but except in those fields where all publications are in alphabetical order, it is expected that the first author should generally be the one who contributed most to the work. Thus, if you wrote the bulk of the document, then normal academic practice would be for you to be the first author (I assume you are not in an "always alphabetical" field).
An invited editorial is a bit different, since the people soliciting the editorial were probably wanting to get the opinion of the person they invited. As such, putting you as the first author may cause embarrassment to your colleague and might annoy the journal. Your colleague should probably have checked with the journal before asking you to write the editorial, rather than trying to conceal their lack of work by claiming first authorship.
To put a person who hasn't done much work as first author, however, is dishonest and will reflect badly on you as well as your colleague.