$k$ is the curvature of spatial slices, not the full spacetime, and it varies with $\dot a$ because it's essentially defined by the local motion of matter.
Take a bunch of parallel lines in Euclidean space, draw small local neighborhoods of the plane perpendicular to each one, and stitch them together. You'll get a plane. Now do the same with lines that are not quite parallel. You'll get a curved surface. The curvature will increase linearly with the degree to which the lines deviate from being parallel. If they're radiating out from a common point then you'll get a portion of a sphere whose radius is the distance to the origin point. If they are actually curves and don't converge at that point, you'll get a sphere whose radius is a linearly extrapolated apparent origin point.
In general relativity the same thing happens, with planes of simultaneity in local frames at rest with the Hubble flow standing in for the perpendicular planes in Euclidean space. There are two differences. First, "spheres" with timelike radius have negative curvature, which is why $\dot a^2+k$ instead of $\dot a^2-k$ appears in the first Friedmann equation (note that $k$ is the square of what I called the curvature above). Second, the spacetime you're slicing can be curved as well, which is why the right hand side of the equation is not zero.