Today's passages commend thanksgiving to us by way of negative example, namely the unthankfulness of the ungodly.
The first passage, from Romans, is a condemnation of men who do not worship God. They, in some sense, knew God, but they did not give him thanks. Instead, they worshiped and served the creature rather than the creator.
The second passage is similar. It describes certain men whom we should avoid as being, among many other things, unthankful. These are men who "hav[e] a form of godliness but deny the power thereof."
If we understand the power of God we should give thanks to Him. We should thank Him for his works of Creation and Providence and general, for his salvation of his elect, and for his mercies to us in particular. Such thanksgiving is a proper recognition of the power of God.
For the wrath of God is revealed from heaven against all ungodliness and unrighteousness of men, who hold the truth in unrighteousness; because that which may be known of God is manifest in them; for God hath shewed it unto them.
For the invisible things of him from the creation of the world are clearly seen, being understood by the things that are made, even his eternal power and Godhead; so that they are without excuse: because that, when they knew God, they glorified him not as God, neither were thankful; but became vain in their imaginations, and their foolish heart was darkened.
Professing themselves to be wise, they became fools, and changed the glory of the uncorruptible God into an image made like to corruptible man, and to birds, and fourfooted beasts, and creeping things. Wherefore God also gave them up to uncleanness through the lusts of their own hearts, to dishonour their own bodies between themselves: who changed the truth of God into a lie, and worshipped and served the creature more than the Creator, who is blessed for ever. Amen.
2 Timothy 3:1-5
This know also, that in the last days perilous times shall come. For men shall be lovers of their own selves, covetous, boasters, proud, blasphemers, disobedient to parents, unthankful, unholy, without natural affection, trucebreakers, false accusers, incontinent, fierce, despisers of those that are good, traitors, heady, highminded, lovers of pleasures more than lovers of God; having a form of godliness, but denying the power thereof: from such turn away.