Consider these sorted elements:
Vi={10, 5, 5, 5, 5, 5, 5}
Wi={4, 1, 1, 1, 1, 1, 1}
With your algorithm if your WEIGHT_MAX is 4, you would choose just the V=10 element (total value 10). But the optimal solution would be 4 elements with V=5 (total value 20).
That's why your algorithm doesn't lead to optimum.
A few algorithms to solve it: http://en.wikipedia.org/wiki/Knapsack_problem