If God is omnipresent and formless, then how did he attain human form in Puranas? What is the belief behind that?
यद्यदाचरति श्रेष्ठस्तत्तदेवेतरो जनः । स यत्प्रमाणं कुरुते
लोकस्तदनुवर्तते ॥ 3.21
न मे पार्थास्ति कर्तव्यं त्रिषु लोकेषु किञ्चन । नानवाप्तमवाप्तव्यं
वर्त एव च कर्मणि ॥ 3.22
Whatever action is performed by a great man, common men follow in his
footsteps. And whatever standards he sets by exemplary acts, all the
world pursues. O son of Prtha, there is no work prescribed for Me
within all the three planetary systems. Nor am I in want of anything,
nor have I need to obtain anything—and yet I am engaged in work.
Above explains that why human birth is required, and not magically fix everything. The purpose is not only to kill Ravana or Kansh, but common men should also be able to cop up with their day to day issues by following great man.
यदा यदा हि धर्मस्य ग्लानिर्भवति भारत ।
अभ्युत्थानमधर्मस्य तदात्मानं सृजाम्यहम् ॥ 4.7
परित्राणाय साधूनां विनाशाय च दुष्कृताम् ।
धर्मसंस्थापनार्थाय संभवामि युगे युगे ॥ 4.8
Whenever and wherever there is a decline in religious practice, O
descendant of Bharata, and a predominant rise of irreligion-at that
time I descend Myself. To deliver the pious and to annihilate
the miscreants, as well as to reestablish the principles of religion,
I advent Myself millennium after millennium.
Above explanation is on why there is a need for Lord to human incarnate.
How did Brahman become God in human form?
How lord takes human birth - it is through Maya or Prakruti. Or you can understand in this way that Maya/Prakruti is itself God, and when there is an imbalance of Dharma and Adharma then God takes a human birth, so He does not become (or transformation - because both entity still exists).
Are Puranas just for understanding the brahman better? or did Brahman really incarnated as Rama, Krishna etc?
Both
Why did Brahman born as a male only in all avatars?
If you are considering only Lord Vishnu/Shiv Avatars - then he only comes with a man form. But is Lord Vishnu the only form of god? There are many female forms as well - Even Lord Vishnu did have "https://en.wikipedia.org/wiki/Mohini"
Note: As per the context or nature of these questions, I am assuming that "Brahman" word is for "Sagun Brahman".