Essentially the same calculation that you did, tells you that if you first fix an arbitrary constant c and let
g(t) = f(t, -2t + c),
then g'(t) = 0 for all t. In particular, for any t we have
f(t, -2t + c) = g(t) = g(0) = f(0, c).
Fixing any (x,y) in R^2, putting c = 2x + y and t = x in this, we learn
f(x,y) = f(x, -2x + 2x + y) = f(0, 2x + y).
Since x and y were arbitrary, this shows that the function F(t) = f(0,t) of one variable satisfies f(x,y) = F(x + 2y) for all x and y.
It might help to express the idea used here in geometric language. The given information implies that f is constant along lines in the xy plane that have slope -2. This is the family of curves y = -2x + c, where c varies --- or equivalently, the family of curves 2x + y = c. So for a given (a,b), the value of f(a,b) doesn't "really" depend on (a,b), as much as it simply depends on 2a + b (a single number that, once you know it, tells you which line of slope -2 you are on. So there must be is some function F with f(x,y) = F(2x+y) (although it doesn't immediately tell us what F is). To specifically identify F, we can simply note that if we take x = 0 in f(x,y) = F(2x+y) we learn that f(0,y) = F(y) for all y, and this completely determines F: it must be that F(t) = f(0,t) for all t. Alternatively, we can derive a formula for F by thinking geometrically. If I give you a point (a,b), what line of slope -2 does it lie on? It lies on the line y = -2x + c when b = -2a + c, or when c = b - 2a. Since the point (0,c) = (0, b-2a) also lies on this line, and f is constant on lines of slope -2. we have f(a,b) = f(0,b-2a).
How to come up with the lines of slope -2 from the given information? Well, suppose we fix some value k and think of the level curve f(x,y) = k as implicitly defining y as a function of x. Taking the derivative with respect to x we learn df/dx(x,y) + df/dy(x,y) dy/dx = 0. Using the given information that df/dx(x,y) = 2 df/dy(x,y) we deduce that 2 df/dy(x,y) + df/dy(x,y) dy/dx = 0. Since the gradient of f is nowhere 0, df/dy is nowhere zero, so we can divide both sides of this last equation by df/dy(x,y) and learn that 2 + dy/dx = 0 or that dy/dx = -2, implying that y = -2x + c for some c, so that the level curve has to be a straight line of slope -2. The calculation that I began this answer with then confirms that the converse is also true (that is: not only does the given information imply that any level curve has to be a straight line of slope -2; it implies that any straight line of slope -2 is indeed a level curve of f). I hope this helped.