In hydrated CuSO4.5H2O the water molecules which surround the central metal Cu2+ function as ligands. These ligands cause crystal field splitting which makes d−d transitions possible. As a result of these d−d transitions energy is released in visible region and CuSO4.5H2O appears blue.
Anhydrous CuSO4 doesn't have any water molecules i.e., it has no ligands. So, in this case no crystal field splitting occurs, hence d−d transition does not take place. That’s why anhydrous CuSO4 is colourless.