What was the scribes and Pharisees purpose in saying to their parents it is a gift by whatsoever you might be profited by me

The scribes and Pharisees would say this to their parents to avoid having to materially support them. They used the excuse that whatever material possessions they had was a gift dedicated to God and therefore not able to be used for their parent's benefit, even though their parents may have been in need. This was a gross deception of the scribes and Pharisees and Jesus rebuked them for it. It was not required by God but was a device of men to circumvent their duty to their parents. This dishonoured the parents and nullified God's commandment that parents are to be honoured by their children (CP Mk 7:5-13). This helps us to better understand Mt 15:1-9.