I've been doing stretches that are supposed to be good for sciatica and piriformis syndrome, but I always hurt more later, what could be the cause?

Pelvis joints. The idea that you have pyriformis syndrome is a speculation. You might have a dysfunctional sacroiliac joint, and the exercises might be stretching these joints. An osteopth can help you to figure this out. See my chronic pain board at quora.Com (free) where i discuss these issues.
About Spasm. Low back pain, sciatica and piriformis syndrome are most commonly the result of muscle spasm, the brain's protective response to perceived trauma -- usually rapid overextension of a muscle. Until the muscles are relaxed (water, heat and OTC naprosyn (naproxen) can help), stretching tends to recreate the direction and mechanism of irritation or perceived injury, and promote persistent spasm.
Not good. If it hurts more afterwards, likely you could be irritating the issue more. I would suggest trying to get some relief of your pain first, then hit the exercises afterwards. Newer research is showing your body may not be working its hardest when your in pain and limiting your ability to heal. See a spine/pain specialist to see what can be done to help you get out of pain.
Wrong exercise. Then you're doing the wrong exercises. Some soreness is to be expected. Sciatica can result from arthritic spurs or herniated disc. Piriformis syndrome from nerve pressure in the hip. The two require a slightly different approach from a pt standpoint. Try referencing robin mckenzie "treat your own back" ($8.32 online). Seek a certified mckenzie pt if in doubt.