Clearly open access has costs, but how does Nature Photonics get to $40k/paper?? Is that how much revenue they expect to derive from the lifetime of the paper?
Only a few percent of papers submitted actually get published. There is some amount of work involved. Also, these top journals hire full time editors (former scientists in ther field).