An £18m wind farm, rejected by councillors, has been approved by the environment minister after the decision was reviewed by his department.