I think it's fine if two people are really attracted to each other, they should be free to do what they want. People can fall in love and there's nothing they can do about it. There's nothing inherently wrong with it per se - I would never go that far.
But there's lots of pitfalls, I feel, and I think it's harder to have a longterm healthy relationship (that meets my goals, anyway, i.e. partnership, equality, stability, mutual respect etc) if you are not in the same age range. Regardless of age, the tone of the relationship needs to be healthy, and Sweetpea points out one example where it probably isn't.
I am never comfortable when the tone is that of the older partner somehow being a parent figure for the younger. I feel the younger partner is in a situation where they're inhibited in their growth into a mature adult human being, because maybe the older partner is making more decisions. I had a gay friend who was in an unhealthy relationship like that - the older man liked that role, they met when my friend was young, but my friend realized eventually that he felt like a puppy or something, so he had to end the relationship, and it was hard at the time because he didn't have as much confidence as he does now.
I also worry that if two people are at the same maturity level but one is 40 and one 20, a) are they really perceiving things correctly, and b) if so, won't the 20-yr-old outgrow the 40 yr old, and mature more quickly. Sort of silly, I know maturity growth is not exactly linear, but I feel the odds are against you in that regards.
The other thing that can be unhealthy is older guys who only find themselves attracted to younger women. I have a single male friend in his mid-50's, and he does not pursue women in his age range. I think it's pretty immature, and yea a bit creepy, if the CRITERIA for even having a date is "I'm not going out with anyone over 45." That's when I start thinking maybe he ended up that old and single for a reason.
Overall, I find it way more natural and conducive to a long-term relationship if the couple is relatively close in age. In fact my wife is about 7 months older than me... but the point is, that wasn't really on purpose, you look for the connection between people.... it has to be there. The age really shouldn't be part of the criteria either way. And let me say, I don't mean to attack people who are in fact having these relationships.
Please enjoy! You are the best judge of what's right for you.