Is the invited author of an editorial always the first author, even if their co-author wrote the whole thing?
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.