Shift register with the Raspberry Pi
Your idea about programmatically setting the clock and data pins is correct. This technique is often called 'bit-banging'. To find out what goes wrong you should post your code.

The 5V / 3.3V issue could very well be your problem. Try to power the HC595's from 3.3V to see how that affects the problem.

The chip in the RaPi has some dedicated hardware that can be used to interface to SPI peripheral like the HC595. But unless you need to shift data out at the maximum speed the use of such a peripheral is not worth the trouble: bit-banging is much easier.

PS you talk about the clock and data pins, are you aware that there is a second clock (hold clock) that you must pulse once per transferred byte, and that there are a few other pins (reset, enable) that must also be kept at the appropriate level?