I have use both hourly billing and flat fee billing. I used to always favour hourly billing on the basis that I felt it was more ethical, but soon changed my mind about this.
The main reason for my change of mind is that time is not always a valid reflector of the value of the work done, e.g.:
A job might take longer but contain more repetitive unskilled work; should it then cost more?
A job might take a shorter amount of time but depend on my primary area of expertise for which I have trained for (at cost) and practised for many years; should I then charge less than someone with less experience and less training?
I will, however, still sometimes use hourly billing. My choice of billing method usually depends on a number of factors:
What the client asks for / insists on. Whether or not I agree it is the best fit, do I refuse for ethical or practical reasons, even if I want the contract? Often I will just accommodate but explain why I think it is a bad idea e.g. that they may end up paying more. I will explain, if necessary, that my hourly rate is quite high for this one because I am charging for my experience/skill level. If I know the client well or they are favoured and I want to keep their custom, I will be more accommodating than with others.
If it is a short and easily estimable job, particularly if it does not require much skill (e.g. making customer-requested edits to a finished work). In these cases it is sometimes easier to just say "This will take me two hour to do and I will charge £60 an hour."
If is a long and not-so-easily estimable job, and I know that I will likely either over or under-estimate it, I will use my best estimate of the hours worked (with some slippage time) but quote the fixed fee because I cannot determine if an hourly rate would work out better or worse for the customer. If the fixed fee I give is agreeable to the customer, then there's no worries on either side - we're both happy.
As you implied in the question, and you can see from the above, that this is a more complex topic than just saying one is more ethical than the other. It depends on several factors such as the the particular circumstances of the business arrangement.
In my view, neither is better or worse that the other ethically because it is impossible to pin the answer down to one that fits every circumstance.
Ultimately, in my view, if you value your work at a certain level, and the customer agrees with your valuation in the form of a signed contract, and you deliver on the contract on time and to spec, then there is nothing ever unethical in the method with which you bill.
What raises issues of good/bad ethics in billing are:
Your intention - do you intend to deceive your customer?
Your honesty and clarity upfront in the contract.
Do you stick to your contract/fee even if your chosen billing method resulted in a loss to you and chalk it up as a learning experience?
Are you willing to shift your fee position if your mistaken choice of billing method ended up causing loss to your customer? (If it's your mistake, your customer should not have to pay for it.)
The above can happen with either hourly or fixed billing, so clearly it's not the billing method, but the biller, that is the determining factor in matters of ethics.
So my answer to your question is:
Neither hourly or fixed price is more or less ethical than the other generally. But, in any particular circumstance, one method may be more ethical depending on the details of the circumstance.
EDIT: Subsequent to posting this answer I found a series of articles that addresses some of the ethical issues of choosing a billing method:
How to Charge for Websites: Fixed-Price Projects
How to Charge for Websites: Pay-Per-Hour Projects
How to Charge for Websites: the Agile Way
The third article may resolve some of the quandaries a freelancer might face in determining how to bill in the most ethical and transparent way.