The choice of volts and current can be based often on an LED's power rating.
If for example it was a 100mW device then using W = E*I = E^2/R = I^2*R you can actually set up the conditions to suit the supply voltage itself.
Go to
this site where there is a handy Jscript calculator.
If then we knew the device was 100mW power rating (just for example) we'd get - 9V supply at 100mW would require a 810 ohm resistor to yield the 100mW. Current would be around 11mA. 820 ohm is the nearest value on the E12 series.
You quote 40mA at 2 volts ....... which equates to 80mW