Flaps do increase drag (especially at higher speeds) but they also decrease the stall speed which is why they're deployed during takeoff and landing-- they allow a slower takeoff speed. In effect, at lower speeds, the lift increase has a bigger effect than the drag.