This happened when I changed my brake pads. If you don't see any brake fluid leaking then air probably got into the brake lines, and the brake fluid needs to be bled or flushed. When I took it in, the tech said that this is normal when you're changing pads/rotors, and that it's standard for them to do a brake bleed whenever they do a change.
I think it's probably because when you step on the pedal the first time, the air compresses, and then when you go to step on it again immediately, the air hasn't expanded again so it feels tighter. But if you let off and drive for a while, the air will expand again.