Cooper didn't have a good season last year and he's having a bad season this year. So the Cowboys are giving up a first round draft pick (currently in the first half of the first round) for a player who may be gone in a season and a half, despite making offseason moves for Allen Hurns and Deonte Thompson and drafting a WR in the third round who isn't seeing the field. Hurns and Thompson have awful numbers, but it's possible that the problem is the guy throwing the passes, not the guys who are supposed to be catching them. Also, the Raiders are tanking and have motivation to unload Cooper for cheaper than a first rounder.
Lastly, a first round pick gets you four years on a rookie deal with a 5th-year option. So the Cowboys have traded that for a guy who may not even be worth a first round pick who they have to decide if they want to pick up the option on next year before he becomes a #2 or #3 receiver or they have to break the bank to re-sign him.
Short version, they should have just drafted DJ Moore, Calvin Ridley, or Courtland Sutton (who has made Demaryius Thomas expendable in the first place).