I have heard that too, but I fear it's just halo effect i.e. if you are kind to animals they will automatically taste better.
Shouldn't be too hard to test if the effect size is large enough. Next time you find yourself hosting a dinner for n meat-eating people, have an accomplice buy n/2 factory-farmed portions of meat and another n/2 ethically farmed portions and label them 1 through n at random, secretly keeping track of which is which. Then cook them all yourself, serve, and give out a survey about the quality of the food. Compare notes afterwards. If your guests protest, tell them they're eating science. Better yet, conspire with a restaurant owner if you happen to know...
Foie gras, the delicacy made from the liver of a very fat goose (or sometimes duck), is believed to be unethical and is therefore frequently banned. For a long time, it was believed that the only way to properly fatten a goose is to continually force-feed it through a tube over several weeks, which is probably a highly unpleasant experience, although it's difficult to tell. Recently, Spanish farmer Eduardo Sousa revealed that under highly specific conditions, you can get geese to fatten themselves voluntarily.
Geese will instinctively gorge themselves when winter is coming on. Eat a goose right after it's fattened itself up for the winter, and you get a delicious treat that died happy. The problem is that geese will only do this if they believe food may become scarce during the winter (or their instinct to gorge only kicks in when the environment is such that that would be a reasonable inference; it's not clear whether it's the goose or evolution doing the analysis). If they realize that food will remain available during the winter, they eat normally. And there are quite a few possible clues--farmers trying to replicate Sousa's setup have discovered that cheating on any part leads to unfatted livers.