Using a homemade carpet cleaner is safe to the environment and your health since it doesn't contain harsh cleaning chemicals such in most commercial cleaners. The ingredients needed to make your own carpet cleaner are not expensive and it is very likely to have already some of them at your home.
