Freshwater availability is increasingly under pressure from growing demand, resource depletion and environmental pollution. Desalination of saline wastewater is an option for supplying households, industry and agriculture with water, but technologies such as reverse osmosis, evaporation or electrodialysis are energy intensive. By contrast, membrane distillation (MD) is a competitive technology for water desalination. In our study, response surface methodology was applied to optimize the direct contact membrane distillation (DCMD) treatment of synthetic saline wastewater. The aim was to enhance the process performance and the permeate flux Jp (L/m2·h) by optimizing the operating parameters: temperature difference ΔT, feed velocity Vf, salt concentration [NaCl], and glucose concentration [Gluc]. The results are a high permeate quality, with 99.9% electrical conductivity reduction and more than 99.9% chemical oxygen demand (COD) removal rate. The predicted optimum permeate flux Jp was 34.1 L/m2·h at ΔT = 55.2 °C and Vf = 0.086 m/s, the two most significant parameters. The model created showed a high degree of correlation between the experimental and the predicted responses, with high statistical significance.