What is the role of miners in Blockchain?
Welcome to Bitcoin.SE!

It is necessary to validate all transactions since it is possible otherwise for A to just broadcast a transaction sending 7 BTC to B even if he does not have enough. A could easily write his own program to do so.

Validating all transactions and the entire blockchain is necessary for Bitcoin to have any value and to ensure consensus rules are followed.